<template>
  <div>
    <div class="analysisGeneration-content1">
      <el-form :model="propsData" ref="analysisGeneration-content1-form" class="analysisGeneration-content1-form">
        <el-form-item label="文件名称" prop="fileName" class="s" :rules="[{ required: true, message: '请输入文件名称', trigger: 'blur' }]">
          <el-input placeholder="请输入文件名称" v-model="propsData.fileName" clearable/>
        </el-form-item>
        <el-form-item label="表名" prop="tableName" class="s" :rules="[{ required: true, message: '请输入表名', trigger: 'blur' }]">
          <el-input placeholder="请输入表名" v-model="propsData.tableName" clearable/>
        </el-form-item>
        <el-form-item label="title名称" prop="titleName" class="s" :rules="[{ required: true, message: '请输入title名称', trigger: 'blur' }]">
          <el-input placeholder="请输入title名称" v-model="propsData.titleName" clearable/>
        </el-form-item>
        <el-form-item label="搜索id" prop="searchId" class="s" :rules="[{ required: true, message: '请输入搜索id', trigger: 'blur' }]">
          <el-input placeholder="请输入搜索id" v-model="propsData.searchId" clearable/>
        </el-form-item>
      </el-form>
      <el-button type="primary" @click="generateApi" class="ml-12">生成api</el-button>
      <div class="demo-css">
        <el-checkbox v-model="propsData.isDemo">是否演示</el-checkbox>
        <el-button type="info" @click="propsData.demoDataProp.isDrawer=true" v-show="propsData.isDemo" class="ml-12">设置演示数据</el-button>
      </div>
    </div>

    <div class="analysisGeneration-content2">
      <span class="s">table数据解析</span>
      <el-input v-model="propsData.tableDataParsing" placeholder="请输入解析数据" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" clearable class="mr-12 "></el-input>
      <el-button type="primary" @click="startParsingClick">表格数据解析</el-button>
    </div>

    <div class="analysisGeneration-content3">
      <el-button size="medium" @click="apiToConfigure">api配置</el-button>
      <el-button size="medium" @click="drawerShow('titleProp')">title配置</el-button>
      <el-button size="medium" @click="drawerShow('formProp')">表单配置</el-button>
      <el-button size="medium" @click="drawerShow('tableProp')">表格配置</el-button>
      <el-button type="success" size="medium" @click="generatePageCodeClick">生成页面代码</el-button>
      <el-button type="info" size="medium" @click="temporaryStorage1">暂存当前生成数据</el-button>
      <el-button type="warning" size="medium" @click="temporaryStorage2">读取前面暂存的数据</el-button>
      <el-upload
          class="upload-demo" ref="upload"
          accept=".js"
          action="https://jsonplaceholder.typicode.com/posts/"
          :on-change="importBackupClick"
          :show-file-list="false"
          :auto-upload="false"
      >
        <el-button slot="trigger" type="primary" style="margin: 0 12px">导入备份生成器数据
        </el-button>
      </el-upload>
      <el-upload
          class="upload-demo" ref="upload"
          accept=".xls,.xlsx"
          action="https://jsonplaceholder.typicode.com/posts/"
          :on-change="upload"
          :show-file-list="false"
          :auto-upload="false"
      >
        <el-button slot="trigger" type="primary" style="margin: 0 12px 0 0">导入生成路由</el-button>
      </el-upload>
      <el-button type="success" @click="downloadImportTemplate('routerTemplate.xlsx')">下载生成路由模板</el-button>
      <el-button type="danger" size="medium" @click="initializationClcik">初始化</el-button>
    </div>


    <!--api 抽屉-->
    <el-drawer
        title="api设置"
        :visible.sync="propsData.apiProp.isDrawer"
        direction="rtl"
        :append-to-body="true"
        :modal-append-to-body="false"
        size="90%"
    >
      <design-api :propsData="propsData" :key="$store.state.randomKey"/>
    </el-drawer>

    <!--title 抽屉-->
    <el-drawer
        title="title设置"
        :visible.sync="propsData.titleProp.isDrawer"
        direction="rtl"
        :append-to-body="true"
        :modal-append-to-body="false"
        size="90%"
    >
      <design-title :propsData="propsData" :key="$store.state.randomKey"/>
    </el-drawer>

    <!--form 抽屉-->
    <el-drawer
        title="form设置"
        :visible.sync="propsData.formProp.isDrawer"
        direction="rtl"
        :append-to-body="true"
        :modal-append-to-body="false"
        size="90%"
    >
      <design-from :propsData="propsData" :key="$store.state.randomKey"/>
    </el-drawer>

    <!--table 抽屉-->
    <el-drawer
        title="table设置"
        :visible.sync="propsData.tableProp.isDrawer"
        direction="rtl"
        :append-to-body="true"
        :modal-append-to-body="false"
        size="93%"
    >
      <design-table :propsData="propsData" :key="$store.state.randomKey"/>
    </el-drawer>

    <!--设置演示数据 抽屉-->
    <el-drawer
        title="设置演示数据"
        :visible.sync="propsData.demoDataProp.isDrawer"
        direction="rtl"
        :append-to-body="true"
        :modal-append-to-body="false"
        size="93%"
    >
      <design-demo-data :propsData="propsData"/>
    </el-drawer>


  </div>


</template>

<script>
import XLSX from 'xlsx'
import {saveAs} from 'file-saver';
import DesignApi from "@/views/analysisGeneration/DesignApi";
import DesignTitle from "@/views/analysisGeneration/DesignTitle";
import DesignFrom from "@/views/analysisGeneration/DesignFrom";
import DesignTable from "@/views/analysisGeneration/DesignTable";
import DesignDemoData from "@/views/analysisGeneration/DesignDemoData";

export default {
  components: {DesignTable, DesignFrom, DesignApi, DesignTitle, DesignDemoData},
  props: [],
  data() {
    return {
      //导出文件集合
      exportFileData: [],
      //生成页面数据
      generateData: {
        endScript: '</scr' + 'ipt>',
        allStyle: '<style lang="scss" scoped></style>',
      },
      //页面基础元素配置
      propsData: {
        fileName: 'navigation',//文件名称
        titleName: '',//title名称
        tableName: '', //表名
        searchId: '',//搜索id
        tableDataParsing: '',//表格数据解析
        isDemo: false,//是否演示

        //设置演示数据
        demoDataProp: {
          isDrawer: false,
          dataConfiguration: '',//数据配置
        },

        //api 设置
        apiProp: {
          isDrawer: false,
          //自动成成的接口
          apiArray: [
            // {
            //   notes: 'table 新增/修改',//api注释 下拉的label值 下拉的value
            //   name: `${this.propsData.fileName}AddEdit`,//api 方法名
            //   path: `/${this.propsData.tableName}/save.do`,//请求地址
            //   mode: 'post',//请求方式
            //   paramsMode: 'data',//参数方式
            // }
          ],
          //手动添加的接口
          apiArray2: [
            // {
            //   notes: 'table 新增/修改',//api注释 下拉的label值 下拉的value
            //   name: `${this.propsData.fileName}AddEdit`,//api 方法名
            //   path: `/${this.propsData.tableName}/save.do`,//请求地址
            //   mode: 'post',//请求方式
            //   paramsMode: 'data',//参数方式
            // }
          ]
        },

        //title 设置
        titleProp: {
          isDrawer: false,
          //按钮集合
          butArray: [
            {
              name: '新增',//按钮名称
              methodName: 'titleAddClick',//按钮方法名称
              icon: 'el-icon-plus',//按钮图标
              color: 'primary',//按钮颜色
              butType: '新增按钮',//按钮属性
              formName: '',//表单名称-下载模板名称-导出的接口
              sort: '0',//排序 从小到大
            }, {
              name: '清空设置',//按钮名称
              methodName: 'tabsOrTableDialogEmpty',//按钮方法名称
              icon: 'el-icon-refresh',//按钮图标
              color: 'danger',//按钮颜色
              butType: '清空设置',//按钮属性
              formName: '',//表单名称-下载模板名称-导出的接口
              sort: '100',//排序 从小到大
            }
          ]
        },

        //表单配置
        formProp: {
          isDrawer: false,
          contentArray: []
          // {
          //   name: '',//表单名称   下拉label 也是name
          //   type: '回显',//表单属性
          //   echoApi: '',//回显api
          //   submitApi: '',//提交api
          //   params: 'id',//回显参数  用,号隔开，自动获取row的参数
          //   dataParsing: '',//数据解析
          //   //字段数组
          //   fieldArray: [
          //     {
          //       name: '11',//名称
          //       type: '输入框',//数据类型
          //       field: '',//字段
          //       startField: '',//开始字段 时间范围
          //       endField: '',//结束字段 时间范围
          //       exportInterface:'/api/',//导出或导入接口
          //       butName:'',//导出或导入按钮名称
          //       required: true,//是否必填 true 必填
          //       display:false,//不可更改  true 不可更改
          //       rowData:false,//是否row数据 true 是
          //       singleFile: true,//文件上传和图片是否多个文件  true 多个
          //       sort: '10',//排序
          //       //单选框-下拉框-多选框 数据来源
          //       selectProp:{
          //         dataSources:'自定义',//单选框-下拉框-多选框 数据来源
          //         interfaceName:'',// 单选框-下拉框-多选框 本页或已有接口 接口名称
          //         labelField:'',//label字段
          //         valueField:'',//value字段
          //         //自定义 下拉框
          //         text:`{label:'',value:''},`,
          //       },
          //     }
          //   ]
          // }
        },

        //表格设置
        tableProp: {
          isDrawer: false,
          isCheckbox: false,//是否多选 true 是
          isSerialNo: true,//是否要序号 true 是
          isPage: true,//是否需要分页
          isBatchBut: false,//是否批量删除
          isSeeOrEditBut: 1,//1：查看/编辑按钮 2：查看 3：都不要
          isDelBut: true,//删除 按钮
          dataParsing: '',//表格内容解析
          //表头按钮配置
          //table头部操作按钮
          headButProp: {
            isDrawer: false,
            butArray: [
              // {
              //   name: '批量删除',//按钮名称
              //   methodName: 'tableTitleButBatchDel',//按钮方法名称
              //   icon: 'el-icon-delete',//按钮图标
              //   color: 'danger',//按钮颜色
              //   butType: '批量删除',//按钮属性
              //   formName: '',//表单名称-下载模板名称-导出的接口
              //   sort: '99',//排序 从小到大
              // },
              {
                name: '配置表头',//按钮名称
                methodName: 'tabsOrTableSetClick',//按钮方法名称
                icon: 'el-icon-setting',//按钮图标
                color: 'white',//按钮颜色
                butType: '配置表头',//按钮属性
                formName: '',//表单名称-下载模板名称-导出的接口
                sort: '100',//排序 从小到大
              }
            ]
          },
          //操作按钮配置
          operationBut: {
            isDrawer: false,
            butArray:
                [
                  {
                    name: '查看/编辑',//按钮名称 //是label也是value值
                    methodName: 'tableSeeClick',//按钮方法名称
                    icon: 'el-icon-view',//按钮图标
                    color: 'primary',//按钮颜色
                    butType: '查看/编辑',//按钮属性
                    formName: '',//表单名称-下载模板名称-导出的接口
                    sort: '0',//排序 从小到大
                  },
                  {
                    name: '删除',//按钮名称
                    methodName: 'tableDelClick',//按钮方法名称
                    icon: 'el-icon-delete',//按钮图标
                    color: 'danger',//按钮颜色
                    butType: '删除',//按钮属性
                    formName: '',//表单名称-下载模板名称-导出的接口
                    sort: '100',//排序 从小到大
                  }
                ],
          },
          //分组名称配置
          groupNameProp: {
            isDrawer: false,
            arrayData: [
              {
                label: '基础设置',//分组名称，是下拉value和label
                sort: '0'
              }
            ],
          },
          //表格数据
          tableArray: []
          /*{
             groupName: '基础设置',//分组名称
             name: '11',//名称
             type: '输入框',//数据类型
             field: '',//字段
             startField: '',//开始字段 时间范围
             endField: '',//结束字段 时间范围
             singleFile: true,//文件上传和图片是否多个文件  true 多个
             required: false,//是否必填 true 必填
             display: false,//不可更改  true 不可更改
             rowData: false,//是否row数据 true 是
             tabsSearch: false,//tabs搜索 true搜索
             sort: '10',//排序
             tableSee: false,//表格不显示 true是
             drawerSee: false,//抽屉查看不显示 true是
             drawerEdit: false,//抽屉编辑不显示 true是
             drawerSeeALine: true,//抽屉查看编辑满一行 true是
             tabsSearchField: false,//tabs搜索字段
             isArray: false,//是否是数组
             isArrayParams:`{label:'id',value:'链表id'},
{label:'api注释前缀',value:'测试'},`,//是数组 id 链表匹配的id字段  api注释前缀 通过这个来增删改查  其它的label就是字段名称 value 就是值 空的话就是先查出来的值
             //单选框-下拉框-多选框 数据来源
             selectProp: {
               dataSources: '自定义',//单选框-下拉框-多选框 数据来源
               interfaceName: '',// 单选框-下拉框-多选框 本页或已有接口 接口名称
               labelField: '',//label字段
               valueField: '',//value字段
               //自定义 下拉框
               text: `{label:'',value:''},`,
             },
           },*/
        }

      },

    };
  },
  mounted() {
  },
  methods: {
    //生成页面代码
    generatePageCodeClick() {
      this.exportFileData = [];
      //开始处理title
      let titleButVue = '';//title按钮vue数据
      let titleData = `` //title data数据
      let titleMethod = '';//title按钮方法数据
      let titleDialogData = '';//title dialog vue
      let titleActivated = '';//title Activated 方法
      let titleComputed = '';//title computed 方法
      //title有按钮的情况
      if (this.propsData.titleProp.butArray.length) {
        let titleButArray = this.propsData.titleProp.butArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
          return p1.sort - p2.sort
        })
        for (let i = 0; i < titleButArray.length; i++) {
          if (titleButArray[i].butType == '新增按钮') {
            titleButVue += `<el-button type="${titleButArray[i].color}" icon="${titleButArray[i].icon} el-icon--left" @click="${titleButArray[i].methodName}">${titleButArray[i].name}</el-button>
             `
            titleMethod += `//title ${titleButArray[i].name} 点击
                          titleAddClick() {
                            this.formData = this.$options.data().formData;
                            this.drawerProp.isDrawer = true;
                            this.drawerProp.loading = false;
                            this.drawerProp.title = '${titleButArray[i].name}';
                            this.drawerProp.status = 'add';
                            this.drawerActiveClick(0)
                          },
            `
            continue
          }
          if (titleButArray[i].butType == '清空设置') {
            titleButVue += `<el-button type="${titleButArray[i].color}" icon="${titleButArray[i].icon} el-icon--left" @click="${titleButArray[i].methodName}">${titleButArray[i].name}</el-button>
             `
            continue
          }
          if (titleButArray[i].butType == '直接导入') {
            titleButVue += `<el-upload
                                  ref="upload${i}"
                                  :action="titleProp.interface${i}"
                                  :show-file-list="false"
                                  list-type="text"
                                  :auto-upload="true"
                                  :on-success="${titleButArray[i].methodName}"
                                  :multiple="false"
                                  name="file"
                                  accept=".xls,.xlsx"
                                  :headers="headersData"
                              >
                                <el-button type="warning" icon="${titleButArray[i].icon} el-icon--left">${titleButArray[i].name}</el-button>
                              </el-upload>
                    `
            titleData += "interface" + i + ":`${window.location.origin}" + titleButArray[i].formName + "?time=${new Date().getTime()}`,//" + titleButArray[i].name + "接口地址";
            titleData += `
              `
            titleMethod += `//title ${titleButArray[i].name} 点击
                              ${titleButArray[i].methodName}(response) {
                                if (response.code === 0) {
                                  this.$message.success('批量上传成功');
                                } else if (response.code === 401) {
                                  this.$message.error('登录超时');
                                  window.location = window.location.origin + window.location.pathname;
                                } else {
                                  this.$message.error(response.msg);
                                }
                                this.initData();
                              },
              `
            continue
          }
          if (titleButArray[i].butType == '下载模板') {
            titleButVue += `<el-button type="${titleButArray[i].color}" icon="${titleButArray[i].icon} el-icon--left" @click="${titleButArray[i].methodName}('${titleButArray[i].formName}')">${titleButArray[i].name}</el-button>
             `
            let download = "`${this.$store.state.env}/upload/downloadTemplate/${text}.xlsx`"
            titleMethod += `//title ${titleButArray[i].name} 点击
                             ${titleButArray[i].methodName}(text) {
                              window.location.href = ${download}
                            },
            `
          }
          if (['对话框后导出', '对话框后导入', '其它按钮'].includes(titleButArray[i].butType)) {
            titleButVue += `<el-button type="${titleButArray[i].color}" icon="${titleButArray[i].icon} el-icon--left" @click="${titleButArray[i].methodName}">${titleButArray[i].name}</el-button>
              `
            titleMethod += `//title ${titleButArray[i].name} 点击
                            ${titleButArray[i].methodName}() {
                              this.titleProp.dialogData${i}.isDialog= true;
                           },
            `
            let titleOption = `//选项
                              optionArray:{
            `
            titleData += `//${titleButArray[i].name} dialog数据
                        dialogData${i}: {
                          isDialog: false,
                          formData:{
            `
            for (let j = 0; j < this.propsData.formProp.contentArray.length; j++) {
              if (titleButArray[i].formName == this.propsData.formProp.contentArray[j].name) {
                titleDialogData += `<!--${this.propsData.formProp.contentArray[j].name} dialog-->
                            <el-dialog
                                        :append-to-body="true"
                                        :close-on-click-modal="false"
                                        :show-close="true"
                                        :close-on-press-escape="false"
                                        title="${this.propsData.formProp.contentArray[j].name}"
                                        @close="${titleButArray[i].methodName}DialogClose"
                                        :visible.sync="titleProp.dialogData${i}.isDialog"
                                        custom-class="public-dialog-css"
                                        width="500px"
                                    >
                                      <el-form :model="titleProp.dialogData${i}.formData" ref="titleDialog${i}Ref" label-width="110px">
                            `;
                titleMethod += `//title ${titleButArray[i].name} dialog 关闭
                              ${titleButArray[i].methodName}DialogClose() {
                                this.titleProp.dialogData${i}.formData = this.$options.data().titleProp.dialogData${i}.formData;
                              },
                `
                //处理字段
                if (this.propsData.formProp.contentArray[j].fieldArray.length) {
                  let fieldArray = this.propsData.formProp.contentArray[j].fieldArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
                    return p1.sort - p2.sort
                  })
                  for (let k = 0; k < fieldArray.length; k++) {
                    let fieldContent = fieldArray[k];
                    let rulesData = `[]`;
                    if (fieldContent.type == '输入框') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" clearable/>
                                        </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '密码框') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" show-password/>
                                        </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '文本域') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" type="textarea" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" :autosize="{ minRows: 2, maxRows: 4}" maxlength="300" show-word-limit/>
                                        </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (['单选框', '多选框', '下拉框'].includes(fieldContent.type)) {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      if (fieldContent.type == '单选框') {
                        titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                           <el-radio-group v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}">
                                            <el-radio v-for="(item,key) in titleProp.dialogData${i}.optionArray.${fieldContent.field}Option" :key="key" :label="item.value">{{ item.label }}</el-radio>
                                          </el-radio-group>
                                        </el-form-item>
                        `
                      }
                      if (fieldContent.type == '多选框') {
                        titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                           <el-checkbox-group v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}">
                                            <el-checkbox v-for="item in titleProp.dialogData${i}.optionArray.${fieldContent.field}Option" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox>
                                          </el-checkbox-group>
                                        </el-form-item>
                        `
                      }
                      if (fieldContent.type == '下拉框') {
                        titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                          <el-select placeholder="请选择${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" filterable clearable :disabled="${fieldContent.display}">
                                            <el-option v-for="item in titleProp.dialogData${i}.optionArray.${fieldContent.field}Option" :key="item.value" :label="item.label" :value="item.value"/>
                                          </el-select>
                                        </el-form-item>
                        `
                      }
                      //选项处理
                      let value = '';
                      if (fieldContent.selectProp.dataSources == '自定义') {
                        let str = `[
                                ${fieldContent.selectProp.text}
                        ]`;
                        let arrayData = eval('(' + str + ')')
                        if (arrayData.length) {
                          value = arrayData[0].value;
                        }
                        titleOption += `//${fieldContent.name} 选项
                                        ${fieldContent.field}Option:${str},
                        `
                      } else if (fieldContent.selectProp.dataSources == '别的页面接口') {
                        titleOption += `//${fieldContent.name} 选项
                                        ${fieldContent.field}Option:[],
                        `
                        titleActivated += `//title ${fieldContent.name} 选项
                                        this.$${fieldContent.selectProp.interfaceName}().then((result) => {
                                          this.titleProp.dialogData${i}.optionArray.${fieldContent.field}Option = result.map(item => ({
                                            label: item.${fieldContent.selectProp.labelField},
                                            value: item.${fieldContent.selectProp.valueField}
                                          }));
                                        })
                        `
                      } else if (fieldContent.selectProp.dataSources == '本页面接口') {
                        titleOption += `//${fieldContent.name} 选项
                                        ${fieldContent.field}Option:[],
                        `
                        for (let l = 0; l < this.propsData.apiProp.apiArray2.length; l++) {
                          if (fieldContent.selectProp.interfaceName == this.propsData.apiProp.apiArray2[l].notes) {
                            titleActivated += `//title ${fieldContent.name} 选项
                                        this.$${this.propsData.apiProp.apiArray2[l].name}().then((result) => {
                                          this.titleProp.dialogData${i}.optionArray.${fieldContent.field}Option = result.map(item => ({
                                            label: item.${fieldContent.selectProp.labelField},
                                            value: item.${fieldContent.selectProp.valueField}
                                          }));
                                        })
                            `
                          }
                        }
                      }
                      if (fieldContent.type == '多选框') {
                        titleData += `${fieldContent.field}:['${value}'],//${fieldContent.name}
                        `
                      } else {
                        titleData += `${fieldContent.field}:'${value}',//${fieldContent.name}
                        `
                      }
                      continue
                    }
                    if (fieldContent.type == '年') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="year" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '月') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="month" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '日') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="date" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '日期和时间') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="datetime" default-time="23:59:59" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '日期和时间范围') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" start-placeholder="开始日期" end-placeholder="结束日期"
                          :default-time="['00:00:00', '23:59:59']" type="datetimerange" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '日期范围') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" start-placeholder="开始日期" end-placeholder="结束日期"
                          :default-time="['00:00:00', '23:59:59']" type="daterange" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '月份范围') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" start-placeholder="开始月份" end-placeholder="结束月份" type="monthrange" value-format="timestamp"/>
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                      continue
                    }
                    if (fieldContent.type == '文件上传') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'blur' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-checkbox-group v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" v-show="false">
                                              <el-checkbox label="">验证需要</el-checkbox>
                                            </el-checkbox-group>
                                            <common-upload-file
                                                :disabled="titleProp.dialogData${i}.optionArray.${fieldContent.field}Option.disabled"
                                                :componentSetOptions="titleProp.dialogData${i}.optionArray.${fieldContent.field}Option"
                                                :uploadValue="titleProp.dialogData${i}.formData.${fieldContent.field}"
                                            />
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:[],//${fieldContent.name}
                      `
                      titleOption += `//${fieldContent.name} 配置
                                        ${fieldContent.field}Option:{
                                          disabled: ${fieldContent.display},//是否禁用
                                          class: '',//上传文件组件需要修改样式的时候用
                                          name: '点击上传',//显示的按钮名称是否叫点击上传
                                          urlType: 'fileName',//后台返回的字段文件字段值
                                          size: 2,//最大上传几MB的文件
                                          limit: 5,//最多上传多少个文件 0 是不限制
                                          multiple: true,//是否支持多选文件上传
                                          accept: '.xls,.xlsx,.doc,.docx',//可上传文件格式,用,号隔开
                                          delMethod: '',//附件删除方法
                                        },
                      `
                      continue
                    }
                    if (fieldContent.type == '图片上传') {
                      if (fieldContent.required) {
                        rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'blur' }]`
                      }
                      titleDialogData += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-checkbox-group v-model="titleProp.dialogData${i}.formData.${fieldContent.field}" v-show="false">
                                              <el-checkbox label="">验证需要</el-checkbox>
                                            </el-checkbox-group>
                                            <common-upload-img
                                              :disabled="titleProp.dialogData${i}.optionArray.${fieldContent.field}Option.disabled"
                                              :componentSetOptions="titleProp.dialogData${i}.optionArray.${fieldContent.field}Option"
                                              :uploadValue="titleProp.dialogData${i}.formData.${fieldContent.field}"
                                            />
                                          </el-form-item>
                      `
                      titleData += `${fieldContent.field}:[],//${fieldContent.name}
                      `
                      titleOption += `//${fieldContent.name} 配置
                                      ${fieldContent.field}Option:{
                                          disabled:  ${fieldContent.display},//是否禁用
                                          isAll: ${fieldContent.singleFile},//上传的是否是多图还是一张的 true 多张 false 单张
                                          class: '',//上传图片需要修改样式的时候用
                                          urlType: 'fileName',//后台返回的字段文件字段值
                                          size: 2,//最大上传几MB的图片
                                          limit: 5,//最多上传多少个张图片 0 是不限制
                                          multiple: true,//是否支持多选文件上传
                                          accept: '.png,.jpg,.jpeg,.gif',//可上传文件格式,用,号隔开 .png,.jpg,.jpeg,.gif
                                        },
                      `
                      continue
                    }
                    if (['导出按钮', '导入按钮'].includes(fieldContent.type)) {
                      let ifData = '';
                      for (let l = 0; l < fieldArray.length; l++) {
                        if (!['文件上传', '图片上传', '导入按钮', '导出按钮'].includes(fieldArray[l].type)) {
                          if (ifData) {
                            ifData += ` && titleProp.dialogData${i}.formData.${fieldArray[l].field}`
                          } else {
                            ifData += `titleProp.dialogData${i}.formData.${fieldArray[l].field}`
                          }
                        }
                      }
                      let ifDataRes = '';
                      if (ifData) {
                        ifDataRes += `v-if="${ifData}"`
                      }

                      //导入/导入条件
                      let search = '';
                      for (let l = 0; l < fieldArray.length; l++) {
                        if (fieldArray[l].type == '年') {
                          search += `searchData.${fieldArray[l].field}=this.Utils.timeDate(searchData.${fieldArray[l].field},1);//${fieldArray[l].name}
                            `
                          continue
                        }
                        if (fieldArray[l].type == '月') {
                          search += `searchData.${fieldArray[l].field}=this.Utils.timeDate(searchData.${fieldArray[l].field},5);//${fieldArray[l].name}
                          `
                          continue
                        }
                        if (fieldArray[l].type == '日') {
                          search += `searchData.${fieldArray[l].field}=this.Utils.timeDate(searchData.${fieldArray[l].field},4);//${fieldArray[l].name}
                          `
                          continue
                        }
                        if (fieldArray[l].type == '日期和时间') {
                          search += `searchData.${fieldArray[l].field}=this.Utils.timeDate(searchData.${fieldArray[l].field},4);//${fieldArray[l].name}
                          `
                          continue
                        }
                        if (fieldArray[l].type == '日期和时间范围') {
                          search += `searchData.${fieldArray[l].startField}=this.Utils.timeDate(searchData.${fieldArray[l].field}? searchData.${fieldArray[l].field}[0] : '',4);//${fieldArray[l].name} 开始
                                     searchData.${fieldArray[l].endField}=this.Utils.timeDate(searchData.${fieldArray[l].field}? searchData.${fieldArray[l].field}[1] : '',4);//${fieldArray[l].name} 结束
                          `
                          continue
                        }
                        if (fieldArray[l].type == '日期范围') {
                          search += `searchData.${fieldArray[l].startField}=this.Utils.timeDate(searchData.${fieldArray[l].field}? searchData.${fieldArray[l].field}[0] : '',4);//${fieldArray[l].name} 开始
                                     searchData.${fieldArray[l].endField}=this.Utils.timeDate(searchData.${fieldArray[l].field}? searchData.${fieldArray[l].field}[1] : '',4);//${fieldArray[l].name} 结束
                          `
                          continue
                        }
                        if (fieldArray[l].type == '月份范围') {
                          search += `searchData.${fieldArray[l].startField}=this.Utils.timeDate(searchData.${fieldArray[l].field}? searchData.${fieldArray[l].field}[0] : '',5);//${fieldArray[l].name} 开始
                                     searchData.${fieldArray[l].endField}=this.Utils.timeDate(searchData.${fieldArray[l].field}? searchData.${fieldArray[l].field}[1] : '',5);//${fieldArray[l].name} 结束
                          `
                          continue
                        }
                      }
                      if (fieldContent.type == '导入按钮') {
                        titleDialogData += `<el-form-item label="${fieldContent.name}"  :rules="[]" ${ifDataRes}>
                                            <el-upload
                                              ref="upload${i}"
                                              :action="titleProp.dialogData${i}.formData.interface${i}"
                                              :show-file-list="false"
                                              list-type="text"
                                              :auto-upload="true"
                                              :on-success="titlePropDialogData${i}Import"
                                              :multiple="false"
                                              name="file"
                                              :data="titleDialogData${i}SearchData"
                                              :before-upload="titlePropDialogData${i}uploadFileUpload"
                                              accept=".xls,.xlsx"
                                              :headers="headersData"
                                            >
                                               <el-button type="warning" icon="el-icon-download el-icon--left">${fieldContent.butName}</el-button>
                                            </el-upload>
                                          </el-form-item>
                      `
                        titleData += "interface" + i + ":`${window.location.origin}" + fieldContent.exportInterface + "?time=${new Date().getTime()}`,//" + fieldContent.name + "接口地址";
                        titleData += `
                      `
                        titleComputed += `//title ${titleButArray[i].name} 导入之前参数
                                       titleDialogData${i}SearchData() {
                                          let searchData=JSON.parse(JSON.stringify(this.titleProp.dialogData${i}.formData));
                                            ${search} return searchData
                                       },
                      `
                        titleMethod += `//title ${titleButArray[i].name} 导入之前
                                      titlePropDialogData${i}uploadFileUpload(file){
                                              const isLt2M = file.size / 1024 / 1024 < 2;
                                              if (!isLt2M) {
                                                this.$message.error('文件大小能超过2MB！');
                                                return false;
                                              }
                                      },
                      `
                        titleMethod += `//title ${titleButArray[i].name} 导入点击
                              titlePropDialogData${i}Import(response) {
                                if (response.code === 0) {
                                  this.$message.success('批量上传成功');
                                } else if (response.code === 401) {
                                  this.$message.error('登录超时');
                                  window.location = window.location.origin + window.location.pathname;
                                } else {
                                  this.$message.error(response.msg);
                                }
                                this.initData();
                              },
                      `
                      }
                      if (fieldContent.type == '导出按钮') {
                        titleDialogData += `<el-form-item label="${fieldContent.name}"  :rules="[]" ${ifDataRes}>
                                             <el-button type="primary" icon="el-icon-upload2 el-icon--left" @click="titleDialogData${i}Export">${fieldContent.butName}</el-button>
                                          </el-form-item>
                      `
                        let exportInterface = "`${window.location.origin}" + fieldContent.exportInterface + "?time=${new Date().getTime()}${condition}`"
                        let exportName = "`" + fieldContent.butName + "${time}.xlsx`"
                        let condition = "`&${key}=${searchData[key]}`"
                        titleMethod += `//title ${titleButArray[i].name} 导出点击
                                      titleDialogData${i}Export(){
                                          let searchData=JSON.parse(JSON.stringify(this.titleProp.dialogData${i}.formData));
                                          ${search} let condition = '';
                                          if (Object.keys(searchData).length) {
                                            for (let key in searchData) {
                                               condition += ${condition}
                                             }
                                          }
                                          let url=${exportInterface}
                                          let time = this.Utils.timeDate(new Date().getTime(), 4)
                                          this.Utils.windowOpen(url, ${exportName})
                                    },
                      `
                      }
                      continue
                    }
                  }
                }
                if (['对话框后导出', '对话框后导入'].includes(titleButArray[i].butType)) {
                  titleDialogData += `</el-form>
                                     <div slot="footer">
                                          <el-button type="danger" @click="titleProp.dialogData${i}.isDialog = false" icon="el-icon-close el-icon--left">关闭</el-button>
                                     </div>
                                  </el-dialog>
                  `
                }
                if (['其它按钮'].includes(titleButArray[i].butType)) {
                  titleDialogData += `</el-form>
                                      <div slot="footer">
                                        <el-button @click="titleProp.dialogData${i}.isDialog = false" icon="el-icon-close el-icon--left">取 消</el-button>
                                        <el-button type="primary" @click="titleDialogData${i}Submit" icon="el-icon-check el-icon--left"> 确 定</el-button>
                                      </div>
                                  </el-dialog>
                  `
                  //提交的值
                  let fieldArray = this.propsData.formProp.contentArray[j].fieldArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
                    return p1.sort - p2.sort
                  })
                  let data = '';
                  for (let l = 0; l < fieldArray.length; l++) {
                    if (fieldArray[l].type == '年') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},1);//${fieldArray[l].name}
                            `
                      continue
                    }
                    if (fieldArray[l].type == '月') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},5);//${fieldArray[l].name}
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},4);//${fieldArray[l].name}
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日期和时间') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},4);//${fieldArray[l].name}
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日期和时间范围') {
                      data += `data.${fieldArray[l].startField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[0] : '',4);//${fieldArray[l].name} 开始
                               data.${fieldArray[l].endField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[1] : '',4);//${fieldArray[l].name} 结束
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日期范围') {
                      data += `data.${fieldArray[l].startField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[0] : '',4);//${fieldArray[l].name} 开始
                               data.${fieldArray[l].endField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[1] : '',4);//${fieldArray[l].name} 结束
                          `
                      continue
                    }
                    if (fieldArray[l].type == '月份范围') {
                      data += `data.${fieldArray[l].startField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[0] : '',5);//${fieldArray[l].name} 开始
                               data.${fieldArray[l].endField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[1] : '',5);//${fieldArray[l].name} 结束
                          `
                      continue
                    }
                    if (fieldArray[l].type == '多选框') {
                      data += `data.${fieldArray[l].field}=data.${fieldArray[l].field}.toString();//${fieldArray[l].name}
                      `
                      continue
                    }
                    if (fieldArray[l].type == '文件上传') {
                      data += `data.${fieldArray[l].field}=JSON.stringify(data.${fieldArray[l].field});//${fieldArray[l].name}
                      `
                      continue
                    }
                    if (fieldArray[l].type == '图片上传') {
                      data += `data.${fieldArray[l].field}=JSON.stringify(data.${fieldArray[l].field});//${fieldArray[l].name}
                      `
                      continue
                    }
                  }
                  let interfaceName = '';
                  for (let k = 0; k < this.propsData.apiProp.apiArray2.length; k++) {
                    if (this.propsData.apiProp.apiArray2[k].notes == this.propsData.formProp.contentArray[j].submitApi) {
                      interfaceName = this.propsData.apiProp.apiArray2[k].name;
                    }
                  }

                  titleMethod += `//title ${titleButArray[i].name} dialog 确定
                              titleDialogData${i}Submit() {
                                this.$refs['titleDialog${i}Ref'].validate((valid) => {
                                  if (valid) {
                                     let data=JSON.parse(JSON.stringify(this.titleProp.dialogData${i}.formData));
                                     ${data} this.$${interfaceName}(data).then(() => {
                                      this.$message.success('保存成功');
                                      this.titleProp.dialogData${i}.isDialog = false;
                                      this.initData();
                                    })
                                  }
                                })
                              },
                  `
                }
              }
            }
            titleData += `},
                        ${titleOption}},
                          },
            `
            continue
          }
          if (titleButArray[i].butType == '直接导出') {
            titleButVue += `<el-button type="${titleButArray[i].color}" icon="${titleButArray[i].icon} el-icon--left" @click="${titleButArray[i].methodName}">${titleButArray[i].name}</el-button>
             `
            let params = ""
            for (let j = 0; j < this.propsData.tableProp.tableArray.length; j++) {
              let tableArray = this.propsData.tableProp.tableArray[j];
              if (tableArray.tabsSearch) {
                let thisTabsSearchData = "${this.tabsSearchData"
                let symbol = "${"
                if (['输入框', '密码框', '文本域', '单选框', '多选框', '下拉框'].includes(tableArray.type)) {
                  params += `&${tableArray.field}=${thisTabsSearchData}.${tableArray.field}}`
                }
                if (tableArray.type == '年') {
                  params += `&${tableArray.field}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field},1)}`
                  continue
                }
                if (tableArray.type == '月') {
                  params += `&${tableArray.field}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field},5)}`
                  continue
                }
                if (tableArray.type == '日') {
                  params += `&${tableArray.field}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field},4)}`
                  continue
                }
                if (tableArray.type == '日期和时间') {
                  params += `&${tableArray.field}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field},4)}`
                  continue
                }
                if (tableArray.type == '日期和时间范围') {
                  params += `&${tableArray.startField}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field}? this.tabsSearchData.${tableArray.field}[0] : '',4)}&${tableArray.endField}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field}? this.tabsSearchData.${tableArray.field}[1] : '',4)}`
                  continue
                }
                if (tableArray.type == '日期范围') {
                  params += `&${tableArray.startField}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field}? this.tabsSearchData.${tableArray.field}[0] : '',4)}&${tableArray.endField}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field}? this.tabsSearchData.${tableArray.field}[1] : '',4)}`
                  continue
                }
                if (tableArray.type == '月份范围') {
                  params += `&${tableArray.startField}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field}? this.tabsSearchData.${tableArray.field}[0] : '',5)}&${tableArray.endField}=${symbol}this.Utils.timeDate(this.tabsSearchData.${tableArray.field}? this.tabsSearchData.${tableArray.field}[1] : '',5)}`
                  continue
                }
              }
            }
            let url = "`${window.location.origin}" + titleButArray[i].formName + "?time=${new Date().getTime()}" + params + "`"
            let name = "`" + titleButArray[i].name + "${time}.xlsx`"
            titleMethod += `//title ${titleButArray[i].name} 点击
                          ${titleButArray[i].methodName}() {
                           let url=${url}
                            let time = this.Utils.timeDate(new Date().getTime(), 4)
                            this.Utils.windowOpen(url, ${name})
                          },
            `
            continue
          }
        }
      }
      //结束处理 title

      //开始处理tabs
      let tabPane = '';//tabPane vue数据
      let tabsProp = '';//tabs 配置 data
      for (let i = 0; i < this.propsData.tableProp.tableArray.length; i++) {
        if (['单选框', '多选框', '下拉框'].includes(this.propsData.tableProp.tableArray[i].type)) {
          if (this.propsData.tableProp.tableArray[i].tabsSearchField) {
            let str = `[
                        ${this.propsData.tableProp.tableArray[i].selectProp.text}
                        ]`;
            let arrayData = eval('(' + str + ')')
            for (let j = 0; j < arrayData.length; j++) {
              tabPane += `<el-tab-pane name="${arrayData[j].value}" label="${arrayData[j].label}"/>`
            }
            tabsProp = `statusField: '${this.propsData.tableProp.tableArray[i].field}',//切换的字段名`
            break
          }
        }
      }
      if (!tabsProp) {
        tabsProp = `statusField: 'status',//切换的字段名`
      }
      let tabsSearchVue = '';//tabs 搜索配置 vue
      let tabsSearchData = '';//tabs 搜索配置 data
      for (let i = 0; i < this.propsData.tableProp.tableArray.length; i++) {
        if (this.propsData.tableProp.tableArray[i].tabsSearch) {
          tabsSearchVue += `<!--tabs 高级搜索-->
                         <div class="common-tabs-right">
                                <div class="common-tabs-right-search">
                                  <el-button type="info" @click="tabsProp.SearchDropDown=!tabsProp.SearchDropDown">
                                    高级搜索
                                    <i :class="[tabsProp.SearchDropDown?'el-icon-bottom':'el-icon-top','el-icon--right']"></i>
                                  </el-button>
                                </div>
                              </div>
                              <!--tabs 搜索下拉的值-->
                              <el-collapse-transition v-if="tabsProp.SearchDropDown">
                                <ul class="common-tabs-from" ref="commonTabsFrom">
          `
          break
        }
      }
      //分组信息
      let groupNameArray = this.propsData.tableProp.groupNameProp.arrayData.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
        return p1.sort - p2.sort
      })
      let toConfigureFieldDialogTabsProp = "";//搜索 tabs dialog 字段选择显示
      let toConfigureFieldDialogTableProp = "";//搜索 table dialog 字段选择显示
      let tabsSearchOption = '';//搜索tabs 选项
      let tabsActivated = '';//tabs Activated方法
      let tableArray = this.propsData.tableProp.tableArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
        return p1.sort - p2.sort
      });//表格字段
      for (let i = 0; i < groupNameArray.length; i++) {
        let toConfigureFieldDialogTabsPropOption = ''; //搜索 tabs dialog 字段选择显示 选项
        let toConfigureFieldDialogTablePropOption = ''; //搜索 table dialog 字段选择显示 选项
        for (let j = 0; j < tableArray.length; j++) {
          if (groupNameArray[i].label == tableArray[j].groupName) {
            if (tableArray[j].tabsSearch) {
              toConfigureFieldDialogTabsPropOption += `{checkbox: true, label: '${tableArray[j].name}', show: true, order: 0},
              `
              if (['输入框', '密码框', '文本域', '单选框', '下拉框', '年', '月', '日', '日期和时间', '日期和时间范围', '日期范围', '月份范围'].includes(tableArray[j].type)) {
                tabsSearchData += `${tableArray[j].field}:'',//${tableArray[j].name}
                `
              }
              if (tableArray[j].type == '输入框') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                <span>${tableArray[j].name}</span>
                                <el-input placeholder="请输入${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" clearable/>
                              </li>
                `
              }
              if (tableArray[j].type == '密码框') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                   <el-input placeholder="请输入${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" show-password/>
                                  </li>
                `
              }
              if (tableArray[j].type == '文本域') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                    <el-input type="textarea" placeholder="请输入${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" :autosize="{ minRows: 2, maxRows: 4}" maxlength="300" show-word-limit/>
                                  </li>
                `
              }
              if (['单选框', '多选框', '下拉框'].includes(tableArray[j].type)) {
                if (tableArray[j].type == '单选框') {
                  tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                     <span>${tableArray[j].name}</span>
                                       <el-radio-group v-model="tabsSearchData.${tableArray[j].field}">
                                         <el-radio v-for="(item,key) in tabsSearchOption.${tableArray[j].field}Option" :key="key" :label="item.value">{{ item.label }}</el-radio>
                                       </el-radio-group>
                                    </li>
                  `
                }
                if (tableArray[j].type == '多选框') {
                  tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                     <span>${tableArray[j].name}</span>
                                       <el-checkbox-group v-model="tabsSearchData.${tableArray[j].field}">
                                         <el-checkbox v-for="item in tabsSearchOption.${tableArray[j].field}Option" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox>
                                       </el-checkbox-group>
                                    </li>
                  `
                }
                if (tableArray[j].type == '下拉框') {
                  tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                     <span>${tableArray[j].name}</span>
                                        <el-select placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" filterable clearable>
                                          <el-option v-for="item in tabsSearchOption.${tableArray[j].field}Option" :key="item.value" :label="item.label" :value="item.value"/>
                                        </el-select>
                                    </li>
                  `
                }
                if (tableArray[j].type == '多选框') {
                  tabsSearchData += `${tableArray[j].field}:[],//${tableArray[j].name}
                  `
                  if (tableArray[j].selectProp.dataSources == '自定义') {
                    let str = `[
                                ${tableArray[j].selectProp.text}
                        ]`;
                    tabsSearchOption += `//${tableArray[j].name} 选项
                                        ${tableArray[j].field}Option:${str},
                        `
                  } else if (tableArray[j].selectProp.dataSources == '别的页面接口') {
                    tabsSearchOption += `//${tableArray[j].name} 选项
                                        ${tableArray[j].field}Option:[],
                        `
                    tabsActivated += `//tabs ${tableArray[j].name} 选项
                                        this.$${tableArray[j].selectProp.interfaceName}().then((result) => {
                                          this.tabsSearchOption.${tableArray[j].field}Option = result.map(item => ({
                                            label: item.${tableArray[j].selectProp.labelField},
                                            value: item.${tableArray[j].selectProp.valueField}
                                          }));
                                        })
                        `
                  } else if (tableArray[j].selectProp.dataSources == '本页面接口') {
                    tabsSearchOption += `//${tableArray[j].name} 选项
                                        ${tableArray[j].field}Option:[],
                        `
                    for (let l = 0; l < this.propsData.apiProp.apiArray2.length; l++) {
                      if (tableArray[j].selectProp.interfaceName == this.propsData.apiProp.apiArray2[l].notes) {
                        tabsActivated += `//tabs ${tableArray[j].name} 选项
                                        this.$${this.propsData.apiProp.apiArray2[l].name}().then((result) => {
                                          this.tabsSearchOption.${tableArray[j].field}Option = result.map(item => ({
                                            label: item.${tableArray[j].selectProp.labelField},
                                            value: item.${tableArray[j].selectProp.valueField}
                                          }));
                                        })
                            `
                      }
                    }
                  }
                } else {
                  if (tableArray[j].selectProp.dataSources == '自定义') {
                    let str = `[
                                {label:'全部',value:''},
                                ${tableArray[j].selectProp.text}
                        ]`;
                    tabsSearchOption += `//${tableArray[j].name} 选项
                                        ${tableArray[j].field}Option:${str},
                        `
                  } else if (tableArray[j].selectProp.dataSources == '别的页面接口') {
                    tabsSearchOption += `//${tableArray[j].name} 选项
                                        ${tableArray[j].field}Option:[],
                        `
                    tabsActivated += `//tabs ${tableArray[j].name} 选项
                                        this.$${tableArray[j].selectProp.interfaceName}().then((result) => {
                                          this.tabsSearchOption.${tableArray[j].field}Option = result.map(item => ({
                                            label: item.${tableArray[j].selectProp.labelField},
                                            value: item.${tableArray[j].selectProp.valueField}
                                          }));
                                        this.tabsSearchOption.${tableArray[j].field}Option.unshift({label:'全部',value:''})
                                        })
                        `
                  } else if (tableArray[j].selectProp.dataSources == '本页面接口') {
                    tabsSearchOption += `//${tableArray[j].name} 选项
                                        ${tableArray[j].field}Option:[],
                        `
                    for (let l = 0; l < this.propsData.apiProp.apiArray2.length; l++) {
                      if (tableArray[j].selectProp.interfaceName == this.propsData.apiProp.apiArray2[l].notes) {
                        tabsActivated += `//tabs ${tableArray[j].name} 选项
                                        this.$${this.propsData.apiProp.apiArray2[l].name}().then((result) => {
                                          this.tabsSearchOption.${tableArray[j].field}Option = result.map(item => ({
                                            label: item.${tableArray[j].selectProp.labelField},
                                            value: item.${tableArray[j].selectProp.valueField}
                                          }));
                                          this.tabsSearchOption.${tableArray[j].field}Option.unshift({label:'全部',value:''})
                                        })
                            `
                      }
                    }
                  }
                }
              }
              if (tableArray[j].type == '年') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                     <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" type="year" value-format="timestamp"/>
                                  </li>
                `
              }
              if (tableArray[j].type == '月') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                     <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" type="month" value-format="timestamp"/>
                                  </li>
                `
              }
              if (tableArray[j].type == '日') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                     <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" type="date" value-format="timestamp"/>
                                  </li>
                `
              }
              if (tableArray[j].type == '日期和时间') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                      <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" type="datetime" default-time="23:59:59" value-format="timestamp"/>
                                  </li>
                `
              }
              if (tableArray[j].type == '日期和时间范围') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                     <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" type="datetimerange" value-format="timestamp"/>
                                  </li>
                `
              }
              if (tableArray[j].type == '日期范围') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                     <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" type="daterange" value-format="timestamp"/>
                                  </li>
                `
              }
              if (tableArray[j].type == '月份范围') {
                tabsSearchVue += `<li v-if="Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).checkbox" :style="{order:Utils.tabsShowOrder('${tableArray[j].name}',toConfigureFieldDialog.tabsProp).order}">
                                   <span>${tableArray[j].name}</span>
                                      <el-date-picker placeholder="请选择${tableArray[j].name}" v-model="tabsSearchData.${tableArray[j].field}" start-placeholder="开始月份" end-placeholder="结束月份" type="monthrange" value-format="timestamp"/>
                                  </li>
                `
              }
            }
            if (!tableArray[j].tableSee && !tableArray[j].isArray) {
              toConfigureFieldDialogTablePropOption += `{checkbox: true, label: '${tableArray[j].name}', show: true, order: 0},
              `
            }
            continue
          }
        }
        toConfigureFieldDialogTabsProp += `{
                                            name: '${groupNameArray[i].label}',//标题
                                            show: true,//搜索是否显示
                                            option: [
                                              ${toConfigureFieldDialogTabsPropOption}]
                                          },
            `
        toConfigureFieldDialogTableProp += `{
                                            name: '${groupNameArray[i].label}',//标题
                                            show: true,//搜索是否显示
                                            option: [
                                              ${toConfigureFieldDialogTablePropOption}]
                                          },
            `
      }
      for (let i = 0; i < this.propsData.tableProp.tableArray.length; i++) {
        if (this.propsData.tableProp.tableArray[i].tabsSearch) {
          tabsSearchVue += ` <li v-for="index in tabsProp.liHtmlNum" :key="index+1000" style="order:888"></li>
                      <li class="common-tabs-from-but" style="order:999">
                        <el-button icon="el-icon-setting" circle @click="tabsOrTableSetClick('tabsProp','筛选项配置')"/>
                        <el-button icon="el-icon-refresh el-icon--left" @click="tabsSearchReset">重置</el-button>
                        <el-button icon="el-icon-search el-icon--left" type="primary" @click="tabsSearchDetermine">查询</el-button>
                      </li>
                    </ul>
                  </el-collapse-transition>
          `
          break
        }
      }
      //结束处理tabs

      //开始处理table
      //table 头部按钮
      let tableHeadButArray = this.propsData.tableProp.headButProp.butArray;
      let tableHeadButVue = "";
      for (let i = 0; i < tableHeadButArray.length; i++) {
        if (tableHeadButArray[i].butType == '批量删除') {
          tableHeadButVue += `<el-button type="${tableHeadButArray[i].color}" icon="${tableHeadButArray[i].icon} el-icon--left" @click="${tableHeadButArray[i].methodName}">${tableHeadButArray[i].name}</el-button>`
          continue
        }
        if (tableHeadButArray[i].butType == '配置表头') {
          tableHeadButVue += ` <el-button icon="${tableHeadButArray[i].icon} el-icon--left" @click="tabsOrTableSetClick('tableProp','筛表头配置')">${tableHeadButArray[i].name}</el-button>`
          continue
        }
      }
      //table 表格内容
      let tableContentVue = '';
      let tableProp = this.propsData.tableProp;
      if (tableProp.isCheckbox) {
        tableContentVue += `<el-table-column type="selection" width="50" align="center" fixed="left"/>
        `
      }
      if (tableProp.isSerialNo) {
        tableContentVue += `<el-table-column label="序号" type="index" width="50" align="center" fixed="left"/>
        `
      }
      // 表格内容
      let tableContentArray = this.propsData.tableProp.tableArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
        return p1.sort - p2.sort
      });
      let isArrayGroupName = [];//把是数组的分组名称 集合起来
      let tableSearchOption = "";//table 选项
      let tableActivated = "";//table activated方法

      for (let i = 0; i < tableContentArray.length; i++) {
        if (tableContentArray[i].isArray) {
          isArrayGroupName.push(tableContentArray[i].groupName)
        }
      }
      for (let i = 0; i < tableContentArray.length; i++) {
        if (isArrayGroupName.includes(tableContentArray[i].groupName) || tableContentArray[i].tableSee) {
          continue
        }
        if (['输入框', '密码框', '文本域', '年', '月', '日', '日期和时间'].includes(tableContentArray[i].type)) {
          tableContentVue += `<el-table-column label="${tableContentArray[i].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[i].field}"
                                v-if="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).checkbox"
                         :fixed="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).fixed"/>
          `
          continue
        }

        if (['单选框', '多选框', '下拉框'].includes(tableContentArray[i].type)) {
          //处理字段
          if (tableContentArray[i].selectProp.dataSources == '自定义') {
            let str = `[
                                ${tableContentArray[i].selectProp.text}
                        ]`;
            tableSearchOption += `//table ${tableContentArray[i].name} 选项
                                        ${tableContentArray[i].field}Option:${str},
                        `
          } else if (tableContentArray[i].selectProp.dataSources == '别的页面接口') {
            tableSearchOption += `//${tableContentArray[i].name} 选项
                                        ${tableContentArray[i].field}Option:[],
                        `
            tableActivated += `//table ${tableContentArray[i].name} 选项
                                        this.$${tableContentArray[i].selectProp.interfaceName}().then((result) => {
                                          this.tableSearchOption.${tableContentArray[i].field}Option = result.map(item => ({
                                            label: item.${tableContentArray[i].selectProp.labelField},
                                            value: item.${tableContentArray[i].selectProp.valueField}
                                          }));
                                        })
                        `
          } else if (tableContentArray[i].selectProp.dataSources == '本页面接口') {
            tableSearchOption += `//${tableContentArray[i].name} 选项
                                        ${tableContentArray[i].field}Option:[],
                        `
            for (let l = 0; l < this.propsData.apiProp.apiArray2.length; l++) {
              if (tableContentArray[i].selectProp.interfaceName == this.propsData.apiProp.apiArray2[l].notes) {
                tableActivated += `//table ${tableContentArray[i].name} 选项
                                        this.$${this.propsData.apiProp.apiArray2[l].name}().then((result) => {
                                          this.tableSearchOption.${tableContentArray[i].field}Option = result.map(item => ({
                                            label: item.${tableContentArray[i].selectProp.labelField},
                                            value: item.${tableContentArray[i].selectProp.valueField}
                                          }));
                                        })
                            `
              }
            }
          }

          if (tableContentArray[i].type == '单选框') {
            tableContentVue += `<el-table-column label="${tableContentArray[i].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[i].field}"
                               v-if="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).checkbox"
                               :fixed="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).fixed">
                                <template slot-scope="scope">
                                  <template v-for="item in tableSearchOption.${tableContentArray[i].field}Option">
                                    <template v-if="scope.row.${tableContentArray[i].field}==item.value">
                                      {{ item.label }}
                                    </template>
                                  </template>
                                </template>
                            </el-table-column>
          `
            continue
          }
          if (tableContentArray[i].type == '多选框') {
            tableContentVue += `<el-table-column label="${tableContentArray[i].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[i].field}"
                               v-if="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).checkbox"
                               :fixed="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).fixed">
                                <template slot-scope="scope">
                                  <label v-for="(item,key) in scope.row.${tableContentArray[i].field}" :key="key">
                                    <label v-for="(item2,key2) in tableSearchOption.${tableContentArray[i].field}Option" :key="key2">
                                      <label v-if="item== item2.value">
                                        {{ item2.label }}<i v-if="scope.row.${tableContentArray[i].field}.length>key+1">、</i>
                                      </label>
                                    </label>
                                  </label>
                                </template>
                              </el-table-column>
            `
            continue
          }
          if (tableContentArray[i].type == '下拉框') {
            tableContentVue += `<el-table-column label="${tableContentArray[i].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[i].field}"
                               v-if="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).checkbox"
                               :fixed="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).fixed">
                                 <template slot-scope="scope">
                                    <template v-for="item in tableSearchOption.${tableContentArray[i].field}Option">
                                      <template v-if="scope.row.${tableContentArray[i].field}==item.value">
                                        {{ item.label }}
                                      </template>
                                    </template>
                                 </template>
                              </el-table-column>
            `
            continue
          }
        }
        if (tableContentArray[i].type == '文件上传') {
          tableContentVue += `<el-table-column label="${tableContentArray[i].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[i].field}"
                               v-if="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).checkbox"
                               :fixed="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).fixed">
                                  <template slot-scope="scope">
                                    <div class="table-upload-file-box">
                                      <ul>
                                        <li
                                            v-for="(item,key) in scope.row.${tableContentArray[i].field}"
                                            :key="key"
                                            @click="uploadFileDownload(item.fileName,item)"
                                        >
                                          <i class="el-icon-notebook-2"></i>
                                          <span>{{ item.name }}</span>
                                          <i class="el-icon-download"></i>
                                        </li>
                                      </ul>
                                    </div>
                                  </template>
                              </el-table-column>
            `
          continue
        }
        if (tableContentArray[i].type == '图片上传') {
          tableContentVue += `<el-table-column label="${tableContentArray[i].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[i].field}"
                               v-if="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).checkbox"
                               :fixed="Utils.tableShowFixed('${tableContentArray[i].name}',this.toConfigureFieldDialog.tableProp).fixed">
                                 <template slot-scope="scope">
                                  <div class="table-upload-img-show">
                                    <ul>
                                      <li v-for="(item,key) in  scope.row.${tableContentArray[i].field}" :key="key">
                                        <el-image
                                            :src="$store.state.env+'/'+item.fileName"
                                            :preview-src-list="Utils.arrayMoveOne(item.fileName,scope.row.${tableContentArray[i].field},'fileName')"
                                            @click="clickImage"
                                        >
                                        </el-image>
                                      </li>
                                    </ul>
                                  </div>
                                </template>
                              </el-table-column>
            `
          continue
        }
      }
      // 表格操作方法
      let tableButArray = this.propsData.tableProp.operationBut.butArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
        return p1.sort - p2.sort
      });
      // 表格操作按钮vue
      let tableButVue = '';//table 按钮vue
      let tableDialogProp = "";//table 其它按钮的dialog 数据
      let tableDialogVue = "";//table dialog vue
      let tableDialogMethod = "";//table dialog 方法
      let tableDialogActivated = "";//table dialog 选项activated方法
      for (let i = 0; i < tableButArray.length; i++) {
        if (['查看/编辑', '查看', '删除'].includes(tableButArray[i].butType)) {
          tableButVue += `<el-button type="${tableButArray[i].color}" icon="${tableButArray[i].icon} el-icon--left" @click="${tableButArray[i].methodName}(scope.row,0)">${tableButArray[i].name}</el-button>
          `
          continue
        }
        if (['修改状态'].includes(tableButArray[i].butType)) {
          tableButVue += `<el-button type="${tableButArray[i].color}" icon="${tableButArray[i].icon} el-icon--left" @click="${tableButArray[i].methodName}(scope.row)">${tableButArray[i].name}</el-button>
          `
          let str = `[
                                ${tableButArray[i].formName}
                        ]`;
          let arrayData = eval('(' + str + ')')
          let params = "";
          for (let j = 0; j < arrayData.length; j++) {
            params += `${arrayData[j].label}:'${arrayData[j].value}',
            `
          }
          let interfaceName = "this[`$${this.apiProp.tableAddEdit}`]";
          tableDialogMethod += `//table ${tableButArray[i].name} 点击
                              ${tableButArray[i].methodName}(row) {
                                this.$confirm('是否${tableButArray[i].name}?', {
                                    confirmButtonText: '确定',
                                    cancelButtonText: '取消',
                                    type: 'warning'
                                  }).then(() => {
                                    let data = {
                                      id: row.id,
                                      ${params}
                                    }
                                    ${interfaceName}(data).then(() => {
                                      this.$message.success('${tableButArray[i].name}成功');
                                      this.initData();
                                    })
                                  }).catch(() => {
                                    this.$message.info('已取消');
                                  });
                              },
          `
        }
        if (tableButArray[i].butType == '其它按钮') {
          tableButVue += `<el-button type="${tableButArray[i].color}" icon="${tableButArray[i].icon} el-icon--left" @click="${tableButArray[i].methodName}(scope.row)">${tableButArray[i].name}</el-button>
          `
          let dialogOption = `//选项
                              optionArray:{
            `
          tableDialogProp += `dialogData${i}:{
                                isDialog: false,
                                row:{},
                                formData:{
          `
          for (let j = 0; j < this.propsData.formProp.contentArray.length; j++) {
            if (tableButArray[i].formName == this.propsData.formProp.contentArray[j].name) {
              tableDialogVue += `<!--${this.propsData.formProp.contentArray[j].name} dialog-->
                            <el-dialog
                                        :append-to-body="true"
                                        :close-on-click-modal="false"
                                        :show-close="true"
                                        :close-on-press-escape="false"
                                        title="${this.propsData.formProp.contentArray[j].name}"
                                        @close="${tableButArray[i].methodName}DialogClose"
                                        :visible.sync="tableDialogProp.dialogData${i}.isDialog"
                                        custom-class="public-dialog-css"
                                        width="500px"
                                    >
                                      <el-form :model="tableDialogProp.dialogData${i}.formData" ref="tableDialog${i}Ref" label-width="110px">
                            `
              tableDialogMethod += `//table ${tableButArray[i].name} dialog 关闭
                              ${tableButArray[i].methodName}DialogClose() {
                                this.tableDialogProp.dialogData${i}.formData = this.$options.data().tableDialogProp.dialogData${i}.formData;
                              },
                `
              //处理字段
              if (this.propsData.formProp.contentArray[j].fieldArray.length) {
                let fieldArray = this.propsData.formProp.contentArray[j].fieldArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
                  return p1.sort - p2.sort
                })
                for (let k = 0; k < fieldArray.length; k++) {
                  let fieldContent = fieldArray[k];
                  let rulesData = `[]`;
                  if (fieldContent.type == '输入框') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" clearable/>
                                        </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '密码框') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" show-password/>
                                        </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '文本域') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" type="textarea" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" :autosize="{ minRows: 2, maxRows: 4}" maxlength="300" show-word-limit/>
                                        </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (['单选框', '多选框', '下拉框'].includes(fieldContent.type)) {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    if (fieldContent.type == '单选框') {
                      tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                           <el-radio-group v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}">
                                            <el-radio v-for="(item,key) in tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option" :key="key" :label="item.value">{{ item.label }}</el-radio>
                                          </el-radio-group>
                                        </el-form-item>
                        `
                    }
                    if (fieldContent.type == '多选框') {
                      tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                           <el-checkbox-group v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}">
                                            <el-checkbox v-for="item in tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox>
                                          </el-checkbox-group>
                                        </el-form-item>
                        `
                    }
                    if (fieldContent.type == '下拉框') {
                      tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                          <el-select placeholder="请选择${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" filterable clearable :disabled="${fieldContent.display}">
                                            <el-option v-for="item in tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option" :key="item.value" :label="item.label" :value="item.value"/>
                                          </el-select>
                                        </el-form-item>
                        `
                    }
                    //选项处理
                    let value = '';
                    if (fieldContent.selectProp.dataSources == '自定义') {
                      let str = `[
                                ${fieldContent.selectProp.text}
                        ]`;
                      let arrayData = eval('(' + str + ')')
                      if (arrayData.length) {
                        value = arrayData[0].value;
                      }
                      dialogOption += `//${fieldContent.name} 选项
                                        ${fieldContent.field}Option:${str},
                        `
                    } else if (fieldContent.selectProp.dataSources == '别的页面接口') {
                      dialogOption += `//${fieldContent.name} 选项
                                        ${fieldContent.field}Option:[],
                        `
                      tableDialogActivated += `//table ${this.propsData.formProp.contentArray[j].name} dialog ${fieldContent.name} 选项
                                        this.$${fieldContent.selectProp.interfaceName}().then((result) => {
                                          this.tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option = result.map(item => ({
                                            label: item.${fieldContent.selectProp.labelField},
                                            value: item.${fieldContent.selectProp.valueField}
                                          }));
                                        })
                        `
                    } else if (fieldContent.selectProp.dataSources == '本页面接口') {
                      dialogOption += `//${fieldContent.name} 选项
                                        ${fieldContent.field}Option:[],
                        `
                      for (let l = 0; l < this.propsData.apiProp.apiArray2.length; l++) {
                        if (fieldContent.selectProp.interfaceName == this.propsData.apiProp.apiArray2[l].notes) {
                          tableDialogActivated += `//table ${this.propsData.formProp.contentArray[j].name} dialog ${fieldContent.name} 选项
                                        this.$${this.propsData.apiProp.apiArray2[l].name}().then((result) => {
                                          this.tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option = result.map(item => ({
                                            label: item.${fieldContent.selectProp.labelField},
                                            value: item.${fieldContent.selectProp.valueField}
                                          }));
                                        })
                            `
                        }
                      }
                    }
                    if (fieldContent.type == '多选框') {
                      tableDialogProp += `${fieldContent.field}:['${value}'],//${fieldContent.name}
                        `
                    } else {
                      tableDialogProp += `${fieldContent.field}:'${value}',//${fieldContent.name}
                        `
                    }
                    continue
                  }
                  if (fieldContent.type == '年') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="year" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '月') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="month" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '日') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="date" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '日期和时间') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="datetime" default-time="23:59:59" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '日期和时间范围') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" start-placeholder="开始日期" end-placeholder="结束日期"
                          :default-time="['00:00:00', '23:59:59']" type="datetimerange" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '日期范围') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" start-placeholder="开始日期" end-placeholder="结束日期"
                          :default-time="['00:00:00', '23:59:59']" type="daterange" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '月份范围') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-date-picker v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" :disabled="${fieldContent.display}" start-placeholder="开始月份" end-placeholder="结束月份" type="monthrange" value-format="timestamp"/>
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:'',//${fieldContent.name}
                      `
                    continue
                  }
                  if (fieldContent.type == '文件上传') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'blur' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-checkbox-group v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" v-show="false">
                                              <el-checkbox label="">验证需要</el-checkbox>
                                            </el-checkbox-group>
                                            <common-upload-file
                                                :disabled="tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option.disabled"
                                                :componentSetOptions="tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option"
                                                :uploadValue="tableDialogProp.dialogData${i}.formData.${fieldContent.field}"
                                            />
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:[],//${fieldContent.name}
                      `
                    dialogOption += `//${fieldContent.name} 配置
                                        ${fieldContent.field}Option:{
                                          disabled: ${fieldContent.display},//是否禁用
                                          class: '',//上传文件组件需要修改样式的时候用
                                          name: '点击上传',//显示的按钮名称是否叫点击上传
                                          urlType: 'fileName',//后台返回的字段文件字段值
                                          size: 2,//最大上传几MB的文件
                                          limit: 5,//最多上传多少个文件 0 是不限制
                                          multiple: true,//是否支持多选文件上传
                                          accept: '.xls,.xlsx,.doc,.docx',//可上传文件格式,用,号隔开
                                          delMethod: '',//附件删除方法
                                        },
                      `
                    continue
                  }
                  if (fieldContent.type == '图片上传') {
                    if (fieldContent.required) {
                      rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'blur' }]`
                    }
                    tableDialogVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="s" :rules="${rulesData}">
                                            <el-checkbox-group v-model="tableDialogProp.dialogData${i}.formData.${fieldContent.field}" v-show="false">
                                              <el-checkbox label="">验证需要</el-checkbox>
                                            </el-checkbox-group>
                                            <common-upload-img
                                              :disabled="tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option.disabled"
                                              :componentSetOptions="tableDialogProp.dialogData${i}.optionArray.${fieldContent.field}Option"
                                              :uploadValue="tableDialogProp.dialogData${i}.formData.${fieldContent.field}"
                                            />
                                          </el-form-item>
                      `
                    tableDialogProp += `${fieldContent.field}:[],//${fieldContent.name}
                      `
                    dialogOption += `//${fieldContent.name} 配置
                                      ${fieldContent.field}Option:{
                                          disabled:  ${fieldContent.display},//是否禁用
                                          isAll: ${fieldContent.singleFile},//上传的是否是多图还是一张的 true 多张 false 单张
                                          class: '',//上传图片需要修改样式的时候用
                                          urlType: 'fileName',//后台返回的字段文件字段值
                                          size: 2,//最大上传几MB的图片
                                          limit: 5,//最多上传多少个张图片 0 是不限制
                                          multiple: true,//是否支持多选文件上传
                                          accept: '.png,.jpg,.jpeg,.gif',//可上传文件格式,用,号隔开 .png,.jpg,.jpeg,.gif
                                        },
                      `
                    continue
                  }
                }
              }
              if (['回显', '提交', '回显并提交'].includes(this.propsData.formProp.contentArray[j].type)) {
                let fieldArray = this.propsData.formProp.contentArray[j].fieldArray.sort(function (p1, p2) { //如果返回负数 p1在前 如果返回正数 p2在前
                  return p1.sort - p2.sort
                })
                //字段处理
                let rowData = ""
                let resData = ""
                for (let k = 0; k < fieldArray.length; k++) {
                  if (fieldArray[k].rowData) {
                    rowData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}=row.${fieldArray[k].field};//${fieldArray[k].name}
                    `
                  } else {
                    if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(fieldArray[k].type)) {
                      resData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}=result.data.${fieldArray[k].field};//${fieldArray[k].name}
                      `
                      continue
                    }
                    if (['多选框'].includes(fieldArray[k].type)) {
                      resData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}=result.data.${fieldArray[k].field} ? result.data.${fieldArray[k].field}.split(",") : [];//${fieldArray[k].name}
                      `
                      continue
                    }
                    if (['文件上传', '图片上传'].includes(fieldArray[k].type)) {
                      resData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}= result.data.${fieldArray[k].field} ? JSON.parse(result.data.${fieldArray[k].field}) : [];//${fieldArray[k].name}
                      `
                      continue
                    }
                    if (['日', '日期和时间'].includes(fieldArray[k].type)) {
                      resData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}=this.Utils.stampData13(result.data.${fieldArray[k].field});//${fieldArray[k].name}
                      `
                      continue
                    }
                    if (['年'].includes(fieldArray[k].type)) {
                      resData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}=this.Utils.stampData13(result.data.${fieldArray[k].field},3);//${fieldArray[k].name}
                      `
                      continue
                    }
                    if (['月'].includes(fieldArray[k].type)) {
                      resData += `this.tableDialogProp.dialogData${i}.formData.${fieldArray[k].field}=this.Utils.stampData13(result.data.${fieldArray[k].field},2);//${fieldArray[k].name}
                      `
                      continue
                    }
                  }
                }


                //回显api
                let echoApiData = ""
                if (this.propsData.formProp.contentArray[j].echoApi) {
                  //参数
                  let params = this.propsData.formProp.contentArray[j].params.split(',');
                  let paramsData = `{`;
                  for (let k = 0; k < params.length; k++) {
                    paramsData += `${params[k]}:row.${params[k]},`
                  }
                  paramsData += `}`
                  let interfaceName = '';
                  for (let k = 0; k < this.propsData.apiProp.apiArray2.length; k++) {
                    if (this.propsData.apiProp.apiArray2[k].notes == this.propsData.formProp.contentArray[j].echoApi) {
                      interfaceName = this.propsData.apiProp.apiArray2[k].name;
                    }
                  }
                  echoApiData += `this.$${interfaceName}(${paramsData}).then((result) => {
                       console.log(result);
                       ${resData}
                  })`
                }
                tableDialogMethod += `//table ${tableButArray[i].name} 点击
                  ${tableButArray[i].methodName}(row){
                      this.tableDialogProp.dialogData${i}.row=row;
                      ${echoApiData}
                      ${rowData}
                      this.tableDialogProp.dialogData${i}.isDialog= true;
                  },
                `
                if (['回显'].includes(this.propsData.formProp.contentArray[j].type)) {
                  tableDialogVue += `</el-form>
                                     <div slot="footer">
                                          <el-button type="danger" @click="tableDialogProp.dialogData${i}.isDialog = false" icon="el-icon-close el-icon--left">关闭</el-button>
                                     </div>
                                  </el-dialog>
                  `
                }
                if (['提交', '回显并提交'].includes(this.propsData.formProp.contentArray[j].type)) {
                  tableDialogVue += `</el-form>
                                      <div slot="footer">
                                        <el-button @click="tableDialogProp.dialogData${i}.isDialog = false" icon="el-icon-close el-icon--left">取 消</el-button>
                                        <el-button type="primary" @click="tableDialogData${i}Submit" icon="el-icon-check el-icon--left"> 确 定</el-button>
                                      </div>
                                  </el-dialog>
                  `
                  //提交的值
                  let data = '';
                  for (let l = 0; l < fieldArray.length; l++) {
                    if (fieldArray[l].type == '年') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},1);//${fieldArray[l].name}
                            `
                      continue
                    }
                    if (fieldArray[l].type == '月') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},5);//${fieldArray[l].name}
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},4);//${fieldArray[l].name}
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日期和时间') {
                      data += `data.${fieldArray[l].field}=this.Utils.timeDate(data.${fieldArray[l].field},4);//${fieldArray[l].name}
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日期和时间范围') {
                      data += `data.${fieldArray[l].startField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[0] : '',4);//${fieldArray[l].name} 开始
                               data.${fieldArray[l].endField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[1] : '',4);//${fieldArray[l].name} 结束
                          `
                      continue
                    }
                    if (fieldArray[l].type == '日期范围') {
                      data += `data.${fieldArray[l].startField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[0] : '',4);//${fieldArray[l].name} 开始
                               data.${fieldArray[l].endField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[1] : '',4);//${fieldArray[l].name} 结束
                          `
                      continue
                    }
                    if (fieldArray[l].type == '月份范围') {
                      data += `data.${fieldArray[l].startField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[0] : '',5);//${fieldArray[l].name} 开始
                               data.${fieldArray[l].endField}=this.Utils.timeDate(data.${fieldArray[l].field}? data.${fieldArray[l].field}[1] : '',5);//${fieldArray[l].name} 结束
                          `
                      continue
                    }
                    if (fieldArray[l].type == '多选框') {
                      data += `data.${fieldArray[l].field}=data.${fieldArray[l].field}.toString();//${fieldArray[l].name}
                      `
                      continue
                    }
                    if (fieldArray[l].type == '文件上传') {
                      data += `data.${fieldArray[l].field}=JSON.stringify(data.${fieldArray[l].field});//${fieldArray[l].name}
                      `
                      continue
                    }
                    if (fieldArray[l].type == '图片上传') {
                      data += `data.${fieldArray[l].field}=JSON.stringify(data.${fieldArray[l].field});//${fieldArray[l].name}
                      `
                      continue
                    }
                  }
                  let interfaceName = '';
                  for (let k = 0; k < this.propsData.apiProp.apiArray2.length; k++) {
                    if (this.propsData.apiProp.apiArray2[k].notes == this.propsData.formProp.contentArray[j].submitApi) {
                      interfaceName = this.propsData.apiProp.apiArray2[k].name;
                    }
                  }
                  tableDialogMethod += `//table ${tableButArray[i].name} dialog 确定
                              tableDialogData${i}Submit() {
                                this.$refs['tableDialog${i}Ref'].validate((valid) => {
                                  if (valid) {
                                     let data=JSON.parse(JSON.stringify(this.tableDialogProp.dialogData${i}.formData));
                                     data.id=this.tableDialogProp.dialogData${i}.row.id;
                                     ${data} this.$${interfaceName}(data).then(() => {
                                      this.$message.success('保存成功');
                                      this.tableDialogProp.dialogData${i}.isDialog = false;
                                      this.initData();
                                    })
                                  }
                                })
                              },
                  `
                }
              }

              tableDialogProp += `},
                        ${dialogOption}},
                          },
            `
            }
            continue
          }
        }
      }
      //按钮有多少个字
      if (tableButArray.length) {
        let butSizeWidth = 0;
        for (let i = 0; i < tableButArray.length; i++) {
          butSizeWidth = butSizeWidth + tableButArray[i].name.length * 13 + 54;
        }
        tableContentVue += `<el-table-column label="操作"  width="${butSizeWidth + 36}" align="center" fixed="right">
                              <template slot-scope="scope">
                              ${tableButVue} </template>
                             </el-table-column>
        `
      }
      //是否分页
      let tablePageVue = "";
      if (tableProp.isPage) {
        tablePageVue += `<!--分页-->
                        <div class="common-pagination">
                          <el-pagination
                              @size-change="pageSizeChange"
                              @current-change="pageCurrentChange"
                              :current-page="paginationProp.currentPage"
                              :page-sizes="[10, 20, 50, 100,500,1000]"
                              :page-size="paginationProp.pageSize"
                              layout="total,sizes, prev, pager, next, jumper"
                              :total="paginationProp.total"
                          />
                        </div>`
      }
      //结束处理table

      //开始处理抽屉
      //分组信息 groupNameArray
      // 表格内容 tableContentArray
      let drawerContentLeft = "";//左边内容
      let drawerLeftProp = "";//Data 的配置
      let drawerContentRight = "";//右边的内容
      //给分组是数组的加上 isArray属性 和 字段属性
      for (let i = 0; i < groupNameArray.length; i++) {
        for (let j = 0; j < tableContentArray.length; j++) {
          if (groupNameArray[i].label == tableContentArray[j].groupName) {
            if (tableContentArray[j].isArray) {
              groupNameArray[i].isArray = true;//是否是数组
              groupNameArray[i].field = tableContentArray[j].field;//是数组的字段
              groupNameArray[i].name = tableContentArray[j].name;//是数组的名称
              groupNameArray[i].isArrayParams = tableContentArray[j].isArrayParams;
              groupNameArray[i].params = [];
              //把链表的id出去出来
              let str = `[
                        ${tableContentArray[j].isArrayParams}
                        ]`;
              let arrayData = eval('(' + str + ')')
              for (let k = 0; k < arrayData.length; k++) {
                if (arrayData[k].label == 'id') {
                  groupNameArray[i].fieldId = arrayData[k].value; //链表id名称
                  continue
                }
                if (arrayData[k].label == 'api注释前缀') {
                  groupNameArray[i].apiAnnotationPrefix = arrayData[k].value;//链接api注释前缀
                  continue
                }
                groupNameArray[i].params.push(arrayData[k]);//其它参数 label就是字段名称 value 就是值 空的话就是先查出来的值
              }
            }
          }
        }
      }
      //处理抽屉的vue
      let butDrawerVue = "";// 是数组的提交vue
      for (let i = 0; i < groupNameArray.length; i++) {
        drawerLeftProp += `"${groupNameArray[i].label}",`
        let seeDrawerVue = ""; //查看的vue
        let editDrawerVue = ""; //编辑的vue
        // 处理编辑vue
        for (let j = 0; j < tableContentArray.length; j++) {
          if (tableContentArray[j].drawerEdit || tableContentArray[j].isArray || tableContentArray[j].groupName != groupNameArray[i].label) {
            continue
          }
          let fieldContent = tableContentArray[j];
          let rulesData = `[]`;
          if (fieldContent.type == '输入框') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}"  class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                 <el-input placeholder="请输入${fieldContent.name}" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" clearable/>
                              </el-form-item>
            `
            continue
          }
          if (fieldContent.type == '密码框') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" show-password/>
                                        </el-form-item>
            `
            continue
          }
          if (fieldContent.type == '文本域') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请输入${fieldContent.name}', trigger: 'blur' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-input placeholder="请输入${fieldContent.name}" type="textarea" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" :autosize="{ minRows: 2, maxRows: 4}" maxlength="300" show-word-limit/>
                                        </el-form-item>
            `
            continue
          }
          if (fieldContent.type == '单选框') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                           <el-radio-group v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}">
                                            <el-radio v-for="(item,key) in formDataOption.${fieldContent.field}Option" :key="key" :label="item.value">{{ item.label }}</el-radio>
                                          </el-radio-group>
                                        </el-form-item>
                        `
            continue
          }
          if (fieldContent.type == '多选框') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                           <el-checkbox-group v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}">
                                            <el-checkbox v-for="item in formDataOption.${fieldContent.field}Option" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox>
                                          </el-checkbox-group>
                                        </el-form-item>
                        `
            continue
          }
          if (fieldContent.type == '下拉框') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                          <el-select placeholder="请选择${fieldContent.name}" v-model="formData.${fieldContent.field}" filterable clearable :disabled="${fieldContent.display}">
                                            <el-option v-for="item in formDataOption.${fieldContent.field}Option" :key="item.value" :label="item.label" :value="item.value"/>
                                          </el-select>
                                        </el-form-item>
                        `
            continue
          }
          if (fieldContent.type == '年') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="year" value-format="timestamp"/>
                                          </el-form-item>
                      `
            continue
          }
          if (fieldContent.type == '月') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="month" value-format="timestamp"/>
                                          </el-form-item>
                      `
            continue
          }
          if (fieldContent.type == '日') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="date" value-format="timestamp"/>
                                          </el-form-item>
                      `
            continue
          }
          if (fieldContent.type == '日期和时间') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'change' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-date-picker placeholder="请选择${fieldContent.name}" v-model="formData.${fieldContent.field}" :disabled="${fieldContent.display}" type="datetime" default-time="23:59:59" value-format="timestamp"/>
                                          </el-form-item>
                      `
            continue
          }
          if (fieldContent.type == '文件上传') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'blur' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-checkbox-group v-model="formData.${fieldContent.field}" v-show="false">
                                              <el-checkbox label="">验证需要</el-checkbox>
                                            </el-checkbox-group>
                                            <common-upload-file
                                                :disabled="formDataOption.${fieldContent.field}Option.disabled"
                                                :componentSetOptions="formDataOption.${fieldContent.field}Option"
                                                :uploadValue="formData.${fieldContent.field}"
                                            />
                                          </el-form-item>
                      `
            continue
          }
          if (fieldContent.type == '图片上传') {
            if (fieldContent.required) {
              rulesData = `[{ required: true, message: '请选择${fieldContent.name}', trigger: 'blur' }]`
            }
            editDrawerVue += `<el-form-item label="${fieldContent.name}" prop="${fieldContent.field}" class="common-drawer-edit-li ${fieldContent.drawerSeeALine ? 'li2' : ''}" :rules="${rulesData}">
                                            <el-checkbox-group v-model="formData.${fieldContent.field}" v-show="false">
                                              <el-checkbox label="">验证需要</el-checkbox>
                                            </el-checkbox-group>
                                            <common-upload-img
                                              :disabled="formDataOption.${fieldContent.field}Option.disabled"
                                              :componentSetOptions="formDataOption.${fieldContent.field}Option"
                                              :uploadValue="formData.${fieldContent.field}"
                                            />
                                          </el-form-item>
                      `
            continue
          }
        }
        //vue组合起来
        if (groupNameArray[i].isArray) {
          // 是数组
          drawerContentLeft += `<li :class="[drawerProp.active===${i}?'active':'']" @click="drawerActiveClick(${i})" v-if="drawerProp.status!='add' && drawerProp.status!='edit'">${groupNameArray[i].label}</li>
          `
          butDrawerVue += `<div class="common-drawer-title-add-edit" v-if="drawerProp.status==='handle${i}'">
                             <el-button icon="el-icon-close el-icon--left" @click="drawerSubmitForm('see')">取 消</el-button>
                             <el-button type="primary" icon="el-icon-check el-icon--left" @click="drawerSubmitForm('handle${i}')">保 存</el-button>
                           </div>
          `
          // 处理查看vue
          for (let j = 0; j < tableContentArray.length; j++) {
            if (tableContentArray[j].drawerSee || tableContentArray[j].isArray || tableContentArray[j].groupName != groupNameArray[i].label) {
              continue
            }
            if (['输入框', '密码框', '文本域', '年', '月', '日', '日期和时间'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<el-table-column label="${tableContentArray[j].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[j].field}"/>
              `
              continue
            }
            if (tableContentArray[j].type == '单选框') {
              seeDrawerVue += `<el-table-column label="${tableContentArray[j].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[j].field}">
                                    <template slot-scope="scope">
                                      <template v-for="item in formDataOption.${tableContentArray[j].field}Option">
                                        <template v-if="scope.row.${tableContentArray[j].field}==item.value">
                                          {{ item.label }}
                                        </template>
                                      </template>
                                    </template>
                            </el-table-column>
              `
              continue
            }
            if (tableContentArray[j].type == '多选框') {
              seeDrawerVue += `<el-table-column label="${tableContentArray[j].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[j].field}">
                                <template slot-scope="scope">
                                  <label v-for="(item,key) in scope.row.${tableContentArray[j].field}" :key="key">
                                    <label v-for="(item2,key2) in formDataOption.${tableContentArray[j].field}Option" :key="key2">
                                      <label v-if="item== item2.value">
                                        {{ item2.label }}<i v-if="scope.row.${tableContentArray[j].field}.length>key+1">、</i>
                                      </label>
                                    </label>
                                  </label>
                                </template>
                              </el-table-column>
            `
              continue
            }
            if (tableContentArray[j].type == '下拉框') {
              seeDrawerVue += `<el-table-column label="${tableContentArray[j].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[j].field}">
                                 <template slot-scope="scope">
                                    <template v-for="item in formDataOption.${tableContentArray[j].field}Option">
                                      <template v-if="scope.row.${tableContentArray[j].field}==item.value">
                                        {{ item.label }}
                                      </template>
                                    </template>
                                 </template>
                              </el-table-column>
            `
              continue
            }
            if (tableContentArray[j].type == '文件上传') {
              seeDrawerVue += `<el-table-column label="${tableContentArray[j].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[j].field}">
                                  <template slot-scope="scope">
                                    <div class="table-upload-file-box">
                                      <ul>
                                        <li
                                            v-for="(item,key) in scope.row.${tableContentArray[j].field}"
                                            :key="key"
                                            @click="uploadFileDownload(item.fileName,item)"
                                        >
                                          <i class="el-icon-notebook-2"></i>
                                          <span>{{ item.name }}</span>
                                          <i class="el-icon-download"></i>
                                        </li>
                                      </ul>
                                    </div>
                                  </template>
                              </el-table-column>
            `
              continue
            }
            if (tableContentArray[j].type == '图片上传') {
              seeDrawerVue += `<el-table-column label="${tableContentArray[j].name}" min-width="150" :show-overflow-tooltip="true" align="center" prop="${tableContentArray[j].field}">
                                 <template slot-scope="scope">
                                  <div class="table-upload-img-show">
                                    <ul>
                                      <li v-for="(item,key) in  scope.row.${tableContentArray[j].field}" :key="key">
                                        <el-image
                                            :src="$store.state.env+'/'+item.fileName"
                                            :preview-src-list="Utils.arrayMoveOne(item.fileName,scope.row.${tableContentArray[j].field},'fileName')"
                                            @click="clickImage"
                                        >
                                        </el-image>
                                      </li>
                                    </ul>
                                  </div>
                                </template>
                              </el-table-column>
            `
              continue
            }
          }
          drawerContentRight += `<li class="content-main" ref="drawerLi${i}" v-show="drawerProp.status==='see' || drawerProp.status==='handle${i}'">
                                    <div class="title">
                                      <span></span>
                                      <label>${groupNameArray[i].label}</label>
                                      <div class="s"></div>
                                      <template v-if="drawerProp.status==='see'">
                                        <div class="n" @click="drawerEdit(${i},'handle${i}')">
                                          <i class="el-icon-edit"></i>
                                          新增${groupNameArray[i].label}
                                        </div>
                                      </template>
                                    </div>
                                    <!--查看-->
                                    <div class="see" v-if="drawerProp.status==='see'">
                                        <!--处理记录-->
                                        <div style="height: 15px"></div>
                                        <el-table
                                            ref="table"
                                            :data="formData.${groupNameArray[i].field}"
                                            border
                                            style="width: 100%"
                                            :header-cell-style="{background:'#f5f7fa',color:'#081333',fontWeight: 'normal'}"
                                            class="cc-table-style"
                                        >
                                        ${seeDrawerVue} <el-table-column label="操作" width="210" align="center" fixed="right">
                                            <template slot-scope="scope">
                                              <el-button type="primary" icon="el-icon-edit el-icon--left" @click="drawerTableEdit${i}(scope.row)">编辑</el-button>
                                              <el-button type="danger" icon="el-icon-delete el-icon--left" @click="drawerTableDel${i}(scope.row)">删除</el-button>
                                            </template>
                                          </el-table-column>
                                        </el-table>
                                    </div>
                                    <!--修改-->
                                    <div class="edit" v-if="drawerProp.status==='handle${i}'">
                                      <el-form :model="formData" ref="drawerFrom${i}" class="common-drawer-edit">
                                      ${editDrawerVue} </el-form>
                                    </div>
                                 </li>
          `
        } else {
          // 不是数组
          drawerContentLeft += `<li :class="[drawerProp.active===${i}?'active':'']" @click="drawerActiveClick(${i})">${groupNameArray[i].label}</li>
          `
          // 处理查看vue
          for (let j = 0; j < tableContentArray.length; j++) {
            if (tableContentArray[j].drawerSee || tableContentArray[j].isArray || tableContentArray[j].groupName != groupNameArray[i].label) {
              continue
            }
            if (['输入框', '密码框', '文本域'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 {{ formData.${tableContentArray[j].field} }}
                               </li>
            `
              continue
            }
            if (['单选框', '下拉框'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                  <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                  <template v-for="item in formDataOption.${tableContentArray[j].field}Option">
                                    <template v-if="formData.${tableContentArray[j].field}==item.value">
                                      {{ item.label }}
                                    </template>
                                  </template>
                               </li>
            `
              continue
            }
            if (['多选框'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 <div>
                                  <label v-for="(item,key) in formData.${tableContentArray[j].field}" :key="key">
                                    <label v-for="(item2,key2) in formDataOption.${tableContentArray[j].field}Option" :key="key2">
                                      <label v-if="item== item2.value">
                                        {{ item2.label }}<i v-if="formData.${tableContentArray[j].field}.length>key+1">、</i>
                                      </label>
                                    </label>
                                  </label>
                                </div>
                               </li>
            `
              continue
            }
            if (['年'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 {{  Utils.timeDate(formData.${tableContentArray[j].field}) }}
                               </li>
            `
              continue
            }
            if (['月'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 {{  Utils.timeDate(formData.${tableContentArray[j].field},2) }}
                               </li>
            `
              continue
            }
            if (['日'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 {{  Utils.timeDate(formData.${tableContentArray[j].field},3) }}
                               </li>
            `
              continue
            }
            if (['日期和时间'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 {{  Utils.timeDate(formData.${tableContentArray[j].field},4) }}
                               </li>
            `
              continue
            }
            if (['日'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 {{  Utils.timeDate(formData.${tableContentArray[j].field},3) }}
                               </li>
            `
              continue
            }
            if (['文件上传'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 <div class="table-upload-file-box">
                                  <ul>
                                    <li
                                        v-for="(item,key) in formData.${tableContentArray[j].field}"
                                        :key="key"
                                        @click="uploadFileDownload(item.fileName,item)"
                                    >
                                      <i class="el-icon-notebook-2"></i>
                                      <span>{{ item.name }}</span>
                                      <i class="el-icon-download"></i>
                                    </li>
                                  </ul>
                                </div>
                               </li>
            `
              continue
            }
            if (['图片上传'].includes(tableContentArray[j].type)) {
              seeDrawerVue += `<li class="common-drawer-see-li ${tableContentArray[j].drawerSeeALine ? 'li2' : ''}">
                                 <span class="common-drawer-see-li-title">${tableContentArray[j].name}</span>
                                 <div class="table-upload-img-show">
                                    <ul>
                                      <li v-for="(item,key) in  formData.${tableContentArray[j].field}" :key="key">
                                        <el-image
                                            :src="$store.state.env+'/'+item.fileName"
                                            :preview-src-list="Utils.arrayMoveOne(item.fileName,formData.${tableContentArray[j].field},'fileName')"
                                            @click="clickImage"
                                        >
                                        </el-image>
                                      </li>
                                    </ul>
                                  </div>
                               </li>
            `
              continue
            }
          }
          drawerContentRight += `<li class="content-main" ref="drawerLi${i}">
                                    <div class="title">
                                      <span></span>
                                      <label>${groupNameArray[i].label}</label>
                                      <div class="s"></div>
                                      <template v-if="drawerProp.status==='see' && drawerProp.seeBut">
                                        <div class="n" @click="drawerEdit(${i})">
                                          <i class="el-icon-edit"></i>
                                          编辑
                                        </div>
                                      </template>
                                    </div>
                                    <!--查看-->
                                    <div class="see" v-if="drawerProp.status!=='add' && drawerProp.status!=='edit'">
                                      <ul class="common-drawer-see">
                                      ${seeDrawerVue} </ul>
                                    </div>
                                    <div class="edit" v-if="drawerProp.status==='edit' || drawerProp.status==='add'">
                                      <el-form :model="formData" ref="drawerFrom${i}" class="common-drawer-edit">
                                      ${editDrawerVue} </el-form>
                                    </div>
                                </li>
          `
        }
      }

      //处理抽屉的值 下拉框 下拉框 activated
      let formData = `id: '',
      `
      let formDataOption = ""; //抽屉选项
      let drawerActivated = "";//抽屉选项 activated
      for (let i = 0; i < groupNameArray.length; i++) {
        for (let j = 0; j < tableContentArray.length; j++) {
          if (groupNameArray[i].label == tableContentArray[j].groupName) {
            if (tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit) {
              continue
            }
            if (tableContentArray[j].isArray) {
              formData += `${groupNameArray[i].field}:[],//${groupNameArray[i].name} 字段
              `
              formData += `${groupNameArray[i].fieldId}:'',// ${groupNameArray[i].name} 链表id
              `
              continue
            }
            if (['输入框', '密码框', '文本域', '年', '月', '日', '日期和时间'].includes(tableContentArray[j].type)) {
              formData += `${tableContentArray[j].field}:'',//${tableContentArray[j].name}
              `
            }
            if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
              formData += `${tableContentArray[j].field}:[],//${tableContentArray[j].name}
              `
            }
            if (['多选框', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
              let value = '';
              //处理字段
              if (tableContentArray[j].selectProp.dataSources == '自定义') {
                let str = `[
                                ${tableContentArray[j].selectProp.text}
                        ]`;
                let arrayData = eval('(' + str + ')')
                if (arrayData.length) {
                  value = arrayData[0].value;
                }
                formDataOption += `//${tableContentArray[j].name} 选项
                                   ${tableContentArray[j].field}Option:${str},
                `
              } else if (tableContentArray[j].selectProp.dataSources == '别的页面接口') {
                formDataOption += `//${tableContentArray[j].name} 选项
                                        ${tableContentArray[j].field}Option:[],
                        `
                drawerActivated += `//抽屉 ${tableContentArray[j].groupName} ${tableContentArray[j].name} 选项
                                        this.$${tableContentArray[j].selectProp.interfaceName}().then((result) => {
                                          this.formDataOption.${tableContentArray[j].field}Option = result.map(item => ({
                                            label: item.${tableContentArray[j].selectProp.labelField},
                                            value: item.${tableContentArray[j].selectProp.valueField}
                                          }));
                                        })
                        `
              } else if (tableContentArray[j].selectProp.dataSources == '本页面接口') {
                formDataOption += `//${tableContentArray[j].name} 选项
                                        ${tableContentArray[j].field}Option:[],
                        `
                for (let l = 0; l < this.propsData.apiProp.apiArray2.length; l++) {
                  if (tableContentArray[j].selectProp.interfaceName == this.propsData.apiProp.apiArray2[l].notes) {
                    drawerActivated += `//抽屉 ${tableContentArray[j].groupName} ${tableContentArray[j].name} 选项
                                        this.$${this.propsData.apiProp.apiArray2[l].name}().then((result) => {
                                          this.formDataOption.${tableContentArray[j].field}Option = result.map(item => ({
                                            label: item.${tableContentArray[j].selectProp.labelField},
                                            value: item.${tableContentArray[j].selectProp.valueField}
                                          }));
                                        })
                            `
                  }
                }
              }
              if (tableContentArray[j].type == '多选框') {
                formData += `${tableContentArray[j].field}:['${value}'],//${tableContentArray[j].name}
                        `
              } else {
                formData += `${tableContentArray[j].field}:'${value}',//${tableContentArray[j].name}
                        `
              }
            }
            if (['图片上传'].includes(tableContentArray[j].type)) {
              formDataOption += `//${tableContentArray[j].name} 配置
                                      ${tableContentArray[j].field}Option:{
                                          disabled:  ${tableContentArray[j].display},//是否禁用
                                          isAll: ${tableContentArray[j].singleFile},//上传的是否是多图还是一张的 true 多张 false 单张
                                          class: '',//上传图片需要修改样式的时候用
                                          urlType: 'fileName',//后台返回的字段文件字段值
                                          size: 2,//最大上传几MB的图片
                                          limit: 5,//最多上传多少个张图片 0 是不限制
                                          multiple: true,//是否支持多选文件上传
                                          accept: '.png,.jpg,.jpeg,.gif',//可上传文件格式,用,号隔开 .png,.jpg,.jpeg,.gif
                                        },
                      `
            }
            if (['文件上传'].includes(tableContentArray[j].type)) {
              formDataOption += `//${tableContentArray[j].name} 配置
                                        ${tableContentArray[j].field}Option:{
                                          disabled: ${tableContentArray[j].display},//是否禁用
                                          class: '',//上传文件组件需要修改样式的时候用
                                          name: '点击上传',//显示的按钮名称是否叫点击上传
                                          urlType: 'fileName',//后台返回的字段文件字段值
                                          size: 2,//最大上传几MB的文件
                                          limit: 5,//最多上传多少个文件 0 是不限制
                                          multiple: true,//是否支持多选文件上传
                                          accept: '.xls,.xlsx,.doc,.docx',//可上传文件格式,用,号隔开
                                          delMethod: '',//附件删除方法
                                        },
                      `
            }
          }
        }
      }
      //结束处理抽屉的值

      //是否是演示 开始
      let isDemo = this.propsData.isDemo;
      let demoDataProp = "";//演示数据
      let demoInitMethod = "";//演示的初始化方法
      //演示数据处理
      let demoTableSeeMethods = "";
      if (isDemo) {
        //初始化
        demoDataProp = this.propsData.demoDataProp.dataConfiguration;
        demoInitMethod = `let isDemo=true;
                if(isDemo){
                  return false
                }
                `
        //查看编辑
        demoTableSeeMethods += `let isDemo=true;
                if(isDemo){`;
        let demoTableSeeMethodsResData = "";// 值
        for (let i = 0; i < groupNameArray.length; i++) {
          if (groupNameArray[i].isArray) {
            //是数组处理
            let resData = "";
            for (let j = 0; j < tableContentArray.length; j++) {
              if (groupNameArray[i].label == tableContentArray[j].groupName) {
                if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit) || tableContentArray[j].isArray) {
                  continue
                }
                if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                  resData += `${tableContentArray[j].field} : item${i}.${tableContentArray[j].field},//${tableContentArray[j].name}
                `
                  continue
                }
                if (['多选框'].includes(tableContentArray[j].type)) {
                  resData += `${tableContentArray[j].field} : item${i}.${tableContentArray[j].field},//${tableContentArray[j].name}
                `
                  continue
                }
                if (['年'].includes(tableContentArray[j].type)) {
                  resData += `${tableContentArray[j].field} :this.Utils.dateAllFront(item${i}.${tableContentArray[j].field},3),//${tableContentArray[j].name}
                `
                  continue
                }
                if (['月'].includes(tableContentArray[j].type)) {
                  resData += `${tableContentArray[j].field} :this.Utils.dateAllFront(item${i}.${tableContentArray[j].field},2),//${tableContentArray[j].name}
                `
                  continue
                }
                if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                  resData += `${tableContentArray[j].field} :this.Utils.dateAllFront(item${i}.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                  continue
                }
                if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                  resData += `${tableContentArray[j].field} :item${i}.${tableContentArray[j].field} ? JSON.parse(item${i}.${tableContentArray[j].field}) : [],//${tableContentArray[j].name}
                `
                  continue
                }
              }
            }
            demoTableSeeMethods += `//${groupNameArray[i].label} 接口返回的值
                      this.formData.${groupNameArray[i].field} =  row.${groupNameArray[i].field}.map(item${i} => ({
                        ${resData} }));
          `
            //formData 赋予空值
            for (let j = 0; j < tableContentArray.length; j++) {
              if (groupNameArray[i].label == tableContentArray[j].groupName) {
                if (tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit) {
                  continue
                }
                if (!tableContentArray[j].isArray) {
                  if (['输入框', '密码框', '文本域', '年', '日', '月', '日期和时间'].includes(tableContentArray[j].type)) {
                    demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} = '';//${tableContentArray[j].name}
                  `
                    continue
                  }

                  if (['多选框', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                    let value = '';
                    //处理字段
                    if (tableContentArray[j].selectProp.dataSources == '自定义') {
                      let str = `[
                                ${tableContentArray[j].selectProp.text}
                        ]`;
                      let arrayData = eval('(' + str + ')')
                      if (arrayData.length) {
                        value = arrayData[0].value;
                      }
                    }
                    if (tableContentArray[j].type == '多选框') {
                      demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field}=['${value}'];//${tableContentArray[j].name}
                        `
                    } else {
                      demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field}='${value}';//${tableContentArray[j].name}
                        `
                    }
                  }
                  if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                    demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} = [];//${tableContentArray[j].name}
                  `
                    continue
                  }
                }
              }
            }
          } else {
            for (let j = 0; j < tableContentArray.length; j++) {
              if (groupNameArray[i].label == tableContentArray[j].groupName) {
                if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit)) {
                  continue
                }
                let isRow = "row";//是接口返回的值还是row表格上有的数据
                if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                  demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} = ${isRow}.${tableContentArray[j].field};//${tableContentArray[j].name}
                `
                  continue
                }
                if (['多选框'].includes(tableContentArray[j].type)) {
                  demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} = ${isRow}.${tableContentArray[j].field};//${tableContentArray[j].name}
                `
                  continue
                }
                if (['年'].includes(tableContentArray[j].type)) {
                  demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(${isRow}.${tableContentArray[j].field},3);//${tableContentArray[j].name}
                `
                  continue
                }
                if (['月'].includes(tableContentArray[j].type)) {
                  demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(${isRow}.${tableContentArray[j].field},2);//${tableContentArray[j].name}
                `
                  continue
                }
                if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                  demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(${isRow}.${tableContentArray[j].field});//${tableContentArray[j].name}
                `
                  continue
                }

                if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                  demoTableSeeMethodsResData += `this.formData.${tableContentArray[j].field} =${isRow}.${tableContentArray[j].field} ? JSON.parse(${isRow}.${tableContentArray[j].field}) : [];//${tableContentArray[j].name}
                `
                  continue
                }
              }
            }
          }
        }
        demoTableSeeMethods += `
                  ${demoTableSeeMethodsResData}
                  return false
                }`
      }
      //是否是演示 结束


      //开始处理方法函数
      //分组信息 groupNameArray
      //表格内容 tableContentArray

      //初始化方法开始
      let initTabsPropStatusField = 'params[`${this.tabsProp.statusField}`]'
      //初始化搜索条件
      let tableParamsData = '';
      for (let l = 0; l < tableContentArray.length; l++) {
        if (tableContentArray[l].tabsSearch) {
          if (['输入框', '密码框', '文本域'].includes(tableContentArray[l].type)) {
            tableParamsData += `${tableContentArray[l].field}: encodeURI(this.tabsSearchData.${tableContentArray[l].field}),//${tableContentArray[l].name}
            `
            continue
          }
          if (['单选框', '下拉框'].includes(tableContentArray[l].type)) {
            tableParamsData += `${tableContentArray[l].field}: this.tabsSearchData.${tableContentArray[l].field},//${tableContentArray[l].name}
            `
            continue
          }
          if (['多选框'].includes(tableContentArray[l].type)) {
            tableParamsData += `${tableContentArray[l].field}: this.tabsSearchData.${tableContentArray[l].field}.toString(),//${tableContentArray[l].name}
            `
            continue
          }
          if (tableContentArray[l].type == '年') {
            tableParamsData += `${tableContentArray[l].field}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field},1),//${tableContentArray[l].name}
                            `
            continue
          }
          if (tableContentArray[l].type == '月') {
            tableParamsData += `${tableContentArray[l].field}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field},5),//${tableContentArray[l].name}
                          `
            continue
          }
          if (tableContentArray[l].type == '日') {
            tableParamsData += `${tableContentArray[l].field}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field},4),//${tableContentArray[l].name}
                          `
            continue
          }
          if (tableContentArray[l].type == '日期和时间') {
            tableParamsData += `${tableContentArray[l].field}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field},4),//${tableContentArray[l].name}
                          `
            continue
          }
          if (tableContentArray[l].type == '日期和时间范围') {
            tableParamsData += `${tableContentArray[l].startField}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field}? this.tabsSearchData.${tableContentArray[l].field}[0] : '',4),//${tableContentArray[l].name} 开始
                                     ${tableContentArray[l].endField}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field}? this.tabsSearchData.${tableContentArray[l].field}[1] : '',4),//${tableContentArray[l].name} 结束
                          `
            continue
          }
          if (tableContentArray[l].type == '日期范围') {
            tableParamsData += `${tableContentArray[l].startField}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field}? this.tabsSearchData.${tableContentArray[l].field}[0] : '',4),//${tableContentArray[l].name} 开始
                                     ${tableContentArray[l].endField}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field}? this.tabsSearchData.${tableContentArray[l].field}[1] : '',4),//${tableContentArray[l].name} 结束
                          `
            continue
          }
          if (tableContentArray[l].type == '月份范围') {
            tableParamsData += `${tableContentArray[l].startField}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field}? this.tabsSearchData.${tableContentArray[l].field}[0] : '',5),//${tableContentArray[l].name} 开始
                                     ${tableContentArray[l].endField}:this.Utils.timeDate(this.tabsSearchData.${tableContentArray[l].field}? this.tabsSearchData.${tableContentArray[l].field}[1] : '',5),//${tableContentArray[l].name} 结束
                          `
            continue
          }
        }
      }
      let tableInitInterface = 'this[`$${this.apiProp.tableInit}`]';//初始化接口
      //初始化返回值
      let tableInitResData = "";
      for (let i = 0; i < groupNameArray.length; i++) {
        if (groupNameArray[i].isArray) {
          continue
        }
        for (let j = 0; j < tableContentArray.length; j++) {
          if (groupNameArray[i].label == tableContentArray[j].groupName) {
            if (tableContentArray[j].tableSee) {
              continue
            }
            if (['输入框', '密码框', '文本域', '单选框', '下拉框', '年', '月', '日期和时间'].includes(tableContentArray[j].type)) {
              tableInitResData += `${tableContentArray[j].field}: item.${tableContentArray[j].field},//${tableContentArray[j].name}
              `
              continue
            }
            if (['日'].includes(tableContentArray[j].type)) {
              tableInitResData += `${tableContentArray[j].field}: this.Utils.dateAllFront(item.${tableContentArray[j].field}),//${tableContentArray[j].name}
              `
              continue
            }
            if (['多选框'].includes(tableContentArray[j].type)) {
              tableInitResData += `${tableContentArray[j].field}:item.${tableContentArray[j].field} ? item.${tableContentArray[j].field}.split(',') : [],//${tableContentArray[j].name}
              `
              continue
            }
            if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
              tableInitResData += `${tableContentArray[j].field}: item.${tableContentArray[j].field} ? JSON.parse(item.${tableContentArray[j].field}) : [],//${tableContentArray[j].name}
              `
              continue
            }

          }
        }
      }
      let initMethods = `//初始化
                      initData() {
                          ${demoInitMethod}
                          this.tableProp.loading = true;
                          //下拉接口
                          let variableArray = [];//变量数组
                          if (!this.apiProp.selectApiBoolean) {
                            // const form1=new Promise((resolve)=>{
                            // this.$().then((result) => {
                            //   console.log(result);
                            // this.empUnitIdOption = result.map(item => ({
                            //  label: item.unitName,
                            //  value: item.id
                            //  }));
                            // resolve()
                            // })
                            // })
                            // variableArray.push(form1)
                            this.apiProp.selectApiBoolean = true;
                          }
                          Promise.all(variableArray).then(() => {
                            if (this.apiProp.tableInit) {
                              let params = {
                                page: this.paginationProp.currentPage,
                                row: this.paginationProp.pageSize,
                                ${tableParamsData} }
                              ${initTabsPropStatusField} = this.tabsProp.active==0?'':this.tabsProp.active;
                              ${tableInitInterface}(params).then((result) => {
                                if (result.data) {
                                if (result.data.length == 0) {
                                  if (this.paginationProp.currentPage != 1) {
                                    this.paginationProp.currentPage = this.paginationProp.currentPage - 1;
                                    this.initData()
                                    return false;
                                  }
                                }
                                  this.tableData = result.data.map(item => ({
                                    id:item.id,
                                    ${tableInitResData} }));
                                  this.paginationProp.total = result.count;//总数
                                  this.tableProp.loading = false;
                                } else {
                                  this.tableData = [];
                                  this.paginationProp.total = result.count;//总数
                                  this.tableProp.loading = false;
                                }
                              }, () => {
                                this.tableProp.loading = false;
                              })
                            } else {
                              this.tableProp.loading = false;
                            }
                          })
                        },`
      //初始化方法结束

      //table查看/编辑 开始
      let tableSeeInterfaceName = "this[`$${this.apiProp.tableQuery}`]"
      //接口返回值处理
      let tableSesResData = "";
      for (let i = 0; i < groupNameArray.length; i++) {
        if (groupNameArray[i].isArray) {
          //是数组处理
          //接口参数
          let params = "";
          for (let j = 0; j < groupNameArray[i].params.length; j++) {
            params += `${groupNameArray[i].params[j].label}:${groupNameArray[i].params[j].value ? groupNameArray[i].params[j].value : `result.data.${groupNameArray[i].params[j].label}`}`
          }
          //接口名称
          let interfaceName = "";
          //接口返回值赋值
          let resData = "";
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit) || tableContentArray[j].isArray) {
                continue
              }
              if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} : item${i}.${tableContentArray[j].field},//${tableContentArray[j].name}
                `
                continue
              }
              if (['多选框'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} : item${i}.${tableContentArray[j].field} ? item${i}.${tableContentArray[j].field}.split(",") : [],//${tableContentArray[j].name}
                `
                continue
              }
              if (['年'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :this.Utils.dateAllFront(item${i}.${tableContentArray[j].field},3),//${tableContentArray[j].name}
                `
                continue
              }
              if (['月'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :this.Utils.dateAllFront(item${i}.${tableContentArray[j].field},2),//${tableContentArray[j].name}
                `
                continue
              }
              if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :this.Utils.dateAllFront(item${i}.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                continue
              }
              if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :item${i}.${tableContentArray[j].field} ? JSON.parse(item${i}.${tableContentArray[j].field}) : [],//${tableContentArray[j].name}
                `
                continue
              }
            }
          }
          for (let j = 0; j < this.propsData.apiProp.apiArray2.length; j++) {
            if (this.propsData.apiProp.apiArray2[j].notes == `${groupNameArray[i].apiAnnotationPrefix} 不分页列表`) {
              interfaceName = this.propsData.apiProp.apiArray2[j].name
            }
          }
          tableSesResData += `//${groupNameArray[i].label} 接口返回的值
            this.$${interfaceName}({${groupNameArray[i].fieldId}: result.data.id,${params}}).then((res${i}) => {
                      this.formData.${groupNameArray[i].field} = res${i}.map(item${i} => ({
                        id: item${i}.id,//
                        ${groupNameArray[i].fieldId}: item${i}.${groupNameArray[i].fieldId},//${groupNameArray[i].label} 链表id
                        ${resData} }));
            })
          `
          tableSesResData += `this.formData.${groupNameArray[i].fieldId} = '';//${groupNameArray[i].label} 链表id
          `
          //formData 赋予空值
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if (tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit) {
                continue
              }
              if (!tableContentArray[j].isArray) {
                if (['输入框', '密码框', '文本域', '年', '日', '月', '日期和时间'].includes(tableContentArray[j].type)) {
                  tableSesResData += `this.formData.${tableContentArray[j].field} = '';//${tableContentArray[j].name}
                  `
                  continue
                }

                if (['多选框', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                  let value = '';
                  //处理字段
                  if (tableContentArray[j].selectProp.dataSources == '自定义') {
                    let str = `[
                                ${tableContentArray[j].selectProp.text}
                        ]`;
                    let arrayData = eval('(' + str + ')')
                    if (arrayData.length) {
                      value = arrayData[0].value;
                    }
                  }
                  if (tableContentArray[j].type == '多选框') {
                    tableSesResData += `this.formData.${tableContentArray[j].field}=['${value}'];//${tableContentArray[j].name}
                        `
                  } else {
                    tableSesResData += `this.formData.${tableContentArray[j].field}='${value}';//${tableContentArray[j].name}
                        `
                  }
                }
                if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                  tableSesResData += `this.formData.${tableContentArray[j].field} = [];//${tableContentArray[j].name}
                  `
                  continue
                }
              }
            }
          }
        } else {
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit)) {
                continue
              }
              let isRow = "result.data";//是接口返回的值还是row表格上有的数据
              if (tableContentArray[j].rowData) {
                isRow = "row"
              }

              if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                tableSesResData += `this.formData.${tableContentArray[j].field} = ${isRow}.${tableContentArray[j].field};//${tableContentArray[j].name}
                `
                continue
              }
              if (['多选框'].includes(tableContentArray[j].type)) {
                tableSesResData += `this.formData.${tableContentArray[j].field} = ${isRow}.${tableContentArray[j].field} ? ${isRow}.${tableContentArray[j].field}.split(",") : [];//${tableContentArray[j].name}
                `
                continue
              }
              if (['年'].includes(tableContentArray[j].type)) {
                tableSesResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(${isRow}.${tableContentArray[j].field},3);//${tableContentArray[j].name}
                `
                continue
              }
              if (['月'].includes(tableContentArray[j].type)) {
                tableSesResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(${isRow}.${tableContentArray[j].field},2);//${tableContentArray[j].name}
                `
                continue
              }
              if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                tableSesResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(${isRow}.${tableContentArray[j].field});//${tableContentArray[j].name}
                `
                continue
              }

              if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                tableSesResData += `this.formData.${tableContentArray[j].field} =${isRow}.${tableContentArray[j].field} ? JSON.parse(${isRow}.${tableContentArray[j].field}) : [];//${tableContentArray[j].name}
                `
                continue
              }
            }
          }
        }
      }
      let tableSeeMethods = `//table 点击查看
                  tableSeeClick(row, key)
                  {
                    this.drawerProp.isDrawer = true;
                    this.drawerProp.title = '详细信息';
                    this.drawerProp.status = 'see';
                    if (key !== undefined) {
                      this.drawerActiveClick(key)
                    }
                    ${demoTableSeeMethods}
                    this.formData = this.$options.data().formData;
                    this.drawerProp.loading = true;
                    let params = {
                      id: row.id
                    }
                    ${tableSeeInterfaceName}(params).then((result) => {
                      this.formData.id = result.data.id;
                      ${tableSesResData} this.drawerProp.loading = false;
                    })
                  },`
      //table查看/编辑 结束

      //抽屉点击保存和取消 开始
      let arraySubmitData = "";//是数组提交方法
      let noVariableArray = "";//不是数组提交方法 验证
      let noArrayData = "";//不是数组提交的data值
      for (let i = 0; i < groupNameArray.length; i++) {
        if (groupNameArray[i].isArray) {
          let arrayData = "";//是数组提交的data值
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit)) {
                continue
              }
              if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                arrayData += `${tableContentArray[j].field} : this.formData.${tableContentArray[j].field},//${tableContentArray[j].name}
                `
                continue
              }
              if (['多选框'].includes(tableContentArray[j].type)) {
                arrayData += `${tableContentArray[j].field} : this.formData.${tableContentArray[j].field}.toString(),//${tableContentArray[j].name}
                `
                continue
              }
              if (['年'].includes(tableContentArray[j].type)) {
                arrayData += `${tableContentArray[j].field} : this.Utils.timeDate(this.formData.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                continue
              }
              if (['月'].includes(tableContentArray[j].type)) {
                arrayData += `${tableContentArray[j].field} : this.Utils.timeDate(this.formData.${tableContentArray[j].field},5),//${tableContentArray[j].name}
                `
                continue
              }
              if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                arrayData += `${tableContentArray[j].field} : this.Utils.timeDate(this.formData.${tableContentArray[j].field},4),//${tableContentArray[j].name}
                `
                continue
              }

              if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                arrayData += `${tableContentArray[j].field} : JSON.stringify(this.formData.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                continue
              }
            }
          }
          let interfaceName = "";//提交接口名称
          for (let j = 0; j < this.propsData.apiProp.apiArray2.length; j++) {
            if (this.propsData.apiProp.apiArray2[j].notes == `${groupNameArray[i].apiAnnotationPrefix} 新增/修改`) {
              interfaceName = this.propsData.apiProp.apiArray2[j].name
            }
          }
          //是数组
          arraySubmitData += `//${groupNameArray[i].label}
                if (status === 'handle${i}') {
                  this.$refs['drawerFrom${i}'].validate((valid) => {
                    if (valid) {
                      this.drawerProp.loading = true;
                      let data = {
                        id:this.formData.${groupNameArray[i].fieldId},//
                        ${groupNameArray[i].fieldId}:this.formData.id,//${groupNameArray[i].name} 链表 id
                        ${arrayData}}
                      this.$${interfaceName}(data).then(() => {
                        this.$message.success('保存成功');
                        this.initData();
                        if (status === 'add') {
                          this.drawerProp.isDrawer = false;
                          this.drawerProp.loading = false;
                        } else {
                          this.drawerProp.loading = false;
                          this.drawerProp.status = 'see';
                          this.tableSeeClick({id: this.formData.id})
                        }
                      }, () => {
                        this.drawerProp.loading = false;
                      })
                    }
                  })
                  return false
              }
          `

        } else {
          //不是数组
          //验证
          noVariableArray += `variableArray.push('form' + ${i});
                  variableArray[${i}] = new Promise((resolve) => {
                    this.$refs['drawerFrom${i}'].validate((valid) => {
                      if (valid)
                        resolve()
                    })
                  })
          `
          //data值
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit)) {
                continue
              }
              if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                noArrayData += `${tableContentArray[j].field} : this.formData.${tableContentArray[j].field},//${tableContentArray[j].name}
                `
                continue
              }
              if (['多选框'].includes(tableContentArray[j].type)) {
                noArrayData += `${tableContentArray[j].field} : this.formData.${tableContentArray[j].field}.toString(),//${tableContentArray[j].name}
                `
                continue
              }
              if (['年'].includes(tableContentArray[j].type)) {
                noArrayData += `${tableContentArray[j].field} : this.Utils.timeDate(this.formData.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                continue
              }
              if (['月'].includes(tableContentArray[j].type)) {
                noArrayData += `${tableContentArray[j].field} : this.Utils.timeDate(this.formData.${tableContentArray[j].field},5),//${tableContentArray[j].name}
                `
                continue
              }
              if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                noArrayData += `${tableContentArray[j].field} : this.Utils.timeDate(this.formData.${tableContentArray[j].field},4),//${tableContentArray[j].name}
                `
                continue
              }

              if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                noArrayData += `${tableContentArray[j].field} : JSON.stringify(this.formData.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                continue
              }
            }
          }
        }
      }
      let noArrayInterfaceName = "this[`$${this.apiProp.tableAddEdit}`]";//不是数组接口的名称
      let drawerSubmitForm = `//抽屉 点击保存 和取消
              drawerSubmitForm(status) {
                if (status === 'see') {
                  this.drawerProp.status = 'see';
                  this.tableSeeClick({id: this.formData.id}, this.drawerProp.active);
                  return false
                }
                ${arraySubmitData} //新增不是数组
                let variableArray = [];//变量数组
                ${noVariableArray} Promise.all(variableArray).then(() => {
                    this.drawerProp.loading = true;
                    let data = {
                      id: this.formData.id,
                      ${noArrayData} }
                    ${noArrayInterfaceName}(data).then(() => {
                        this.$message.success('保存成功');
                        this.initData();
                        if (status === 'add') {
                          this.drawerProp.isDrawer = false;
                          this.drawerProp.loading = false;
                        } else {
                          this.drawerProp.loading = false;
                          this.drawerProp.status = 'see';
                          this.tableSeeClick({id: this.formData.id})
                        }
                      }, () => {
                        this.drawerProp.loading = false;
                      })
                    })
              },`
      //抽屉点击保存和取消 开始

      //抽屉编辑开始
      let drawerArrayEdit = "";//是数组的编辑方法
      for (let i = 0; i < groupNameArray.length; i++) {
        if (groupNameArray[i].isArray) {
          drawerArrayEdit += `//新增${groupNameArray[i].label}
              if (handle == 'handle${i}') {
                this.drawerProp.title = '新增${groupNameArray[i].label}';
                this.drawerProp.status = 'handle${i}';
                this.drawerActiveClick(key);
                return false
              }
          `
          continue
        }
      }
      let drawerEdit = `//抽屉 点击编辑
            drawerEdit(key, handle) {
              ${drawerArrayEdit} console.log(handle);
              this.drawerProp.title = '修改详细信息';
              this.drawerProp.status = 'edit';
              this.drawerActiveClick(key);
            },`
      //抽屉编辑结束

      //抽屉里面的链表 编辑和删除方法 开始
      let drawerArrayMethod = "";
      for (let i = 0; i < groupNameArray.length; i++) {
        if (groupNameArray[i].isArray) {
          let drawerArrayResData = "";//链表里面的字段
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit)) {
                continue
              }
              if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                drawerArrayResData += `this.formData.${tableContentArray[j].field} = row.${tableContentArray[j].field};//${tableContentArray[j].name}
                `
                continue
              }
              if (['多选框'].includes(tableContentArray[j].type)) {
                drawerArrayResData += `this.formData.${tableContentArray[j].field} = row.${tableContentArray[j].field} ? row.data.${tableContentArray[j].field}.split(",") : [];//${tableContentArray[j].name}
                `
                continue
              }
              if (['年'].includes(tableContentArray[j].type)) {
                drawerArrayResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(row.${tableContentArray[j].field},3);//${tableContentArray[j].name}
                `
                continue
              }
              if (['月'].includes(tableContentArray[j].type)) {
                drawerArrayResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(row.${tableContentArray[j].field},2);//${tableContentArray[j].name}
                `
                continue
              }
              if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                drawerArrayResData += `this.formData.${tableContentArray[j].field} =this.Utils.stampData13(row.${tableContentArray[j].field});//${tableContentArray[j].name}
                `
                continue
              }

              if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                drawerArrayResData += `this.formData.${tableContentArray[j].field} =row.${tableContentArray[j].field} ? JSON.parse(row.${tableContentArray[j].field}) : [];//${tableContentArray[j].name}
                `
                continue
              }
            }
          }
          drawerArrayMethod += `//${groupNameArray[i].label} 表格里的编辑
              drawerTableEdit${i}(row){
                this.drawerProp.status = 'handle${i}';
                this.formData.${groupNameArray[i].fieldId} = row.id;//${groupNameArray[i].name} 链表id
                ${drawerArrayResData} },
          `

          let interfaceDelName = "";//删除接口名称
          let interfaceAllName = "";//不分页列表接口名称
          for (let j = 0; j < this.propsData.apiProp.apiArray2.length; j++) {
            if (this.propsData.apiProp.apiArray2[j].notes == `${groupNameArray[i].apiAnnotationPrefix} 删除`) {
              interfaceDelName = this.propsData.apiProp.apiArray2[j].name
            }
            if (this.propsData.apiProp.apiArray2[j].notes == `${groupNameArray[i].apiAnnotationPrefix} 不分页列表`) {
              interfaceAllName = this.propsData.apiProp.apiArray2[j].name
            }
          }
          let params = ""; //其它参数
          for (let j = 0; j < groupNameArray[i].params.length; j++) {
            params += `${groupNameArray[i].params[j].label}:${groupNameArray[i].params[j].value ? groupNameArray[i].params[j].value : `row.${groupNameArray[i].params[j].label}`}`
          }
          //接口返回值赋值
          let resData = "";
          for (let j = 0; j < tableContentArray.length; j++) {
            if (groupNameArray[i].label == tableContentArray[j].groupName) {
              if ((tableContentArray[j].drawerSee && tableContentArray[j].drawerEdit) || tableContentArray[j].isArray) {
                continue
              }
              if (['输入框', '密码框', '文本域', '单选框', '下拉框'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} : item${i}.${tableContentArray[j].field},//${tableContentArray[j].name}
                `
                continue
              }
              if (['多选框'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} : item${i}.${tableContentArray[j].field} ? item${i}.${tableContentArray[j].field}.split(",") : [],//${tableContentArray[j].name}
                `
                continue
              }
              if (['年'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :this.Utils.stampData13(item${i}.${tableContentArray[j].field},3),//${tableContentArray[j].name}
                `
                continue
              }
              if (['月'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :this.Utils.stampData13(item${i}.${tableContentArray[j].field},2),//${tableContentArray[j].name}
                `
                continue
              }
              if (['日', '日期和时间'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :this.Utils.stampData13(item${i}.${tableContentArray[j].field}),//${tableContentArray[j].name}
                `
                continue
              }

              if (['文件上传', '图片上传'].includes(tableContentArray[j].type)) {
                resData += `${tableContentArray[j].field} :item${i}.${tableContentArray[j].field} ? JSON.parse(item${i}.${tableContentArray[j].field}) : [],//${tableContentArray[j].name}
                `
                continue
              }
            }
          }
          drawerArrayMethod += ` //${groupNameArray[i].label} 表格里的删除
                  drawerTableDel${i}(row){
                    this.$confirm('此操作将永久删除, 是否继续?', {
                      confirmButtonText: '确定',
                      cancelButtonText: '取消',
                      type: 'warning'
                    }).then(() => {
                      let data = {
                        id: row.id
                      }
                      this.$${interfaceDelName}(data).then(() => {
                        this.$message.success('删除成功');
                        this.$${interfaceAllName}({${groupNameArray[i].fieldId}: this.formData.id,${params}}).then((res${i}) => {
                          this.formData.${groupNameArray[i].field} = res${i}.map(item${i} => ({
                            id: item${i}.id,//
                            ${groupNameArray[i].fieldId}: item${i}.${groupNameArray[i].fieldId},//${groupNameArray[i].label} 链表id
                            ${resData} }));
                        })

                      })
                    }).catch(() => {
                      this.$message.info('已取消删除');
                    });
                  },
          `
        }
      }
      //抽屉里面的链表 编辑和删除方法 结束

      //其它全部的方法集合 开始
      let delInterfaceName = "this[`$${this.apiProp.tableDel}`]";
      let paramsApply1 = "`drawerLi${i}`";
      let paramsApply2 = "this[`$${this.apiProp.tableBatchDel}`]";
      let otherAllMethods = `//tabs 高级搜索 重置按钮
              tabsSearchReset() {
                this.tabsSearchData = this.$options.data().tabsSearchData;
              },
              //tabs 高级搜索 查询按钮点击
              tabsSearchDetermine() {
                this.paginationProp.currentPage = 1;//当前第几页
                this.initData();
              },
              //tabs 切换点击
              tabsSwitchClick() {
                this.paginationProp.currentPage = 1;//当前第几页
                this.initData();
              },
              //table 分页 选择了每页几条
              pageSizeChange(val) {
                this.paginationProp.currentPage = 1;//当前第几页
                this.paginationProp.pageSize = val;//每页几条
                this.initData();
              },
              //table 分页 点击了跳转到第几页
              pageCurrentChange(val) {
                this.paginationProp.currentPage = val;//当前第几页
                this.initData();
              },
              //table 多选
              tableSelectionChange(val) {
                this.tableProp.tableSelectAll = [];
                for (let i = 0; i < val.length; i++) {
                  this.tableProp.tableSelectAll.push(val[i].id)
                }
              },
              //table 点击删除
              tableDelClick(row) {
                this.$confirm('此操作将永久删除, 是否继续?', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
                }).then(() => {
                  let data = {
                    id: row.id
                  }
                  ${delInterfaceName}(data).then(() => {
                    this.$message.success('删除成功');
                    this.initData();
                  })
                }).catch(() => {
                  this.$message.info('已取消删除');
                });
              },
              //抽屉左边 点击切换标题
              drawerActiveClick(key) {
                setTimeout(() => {
                  let scrollHeight = 0;
                  this.drawerLiArray = [];
                  for (let i = 0; i < this.drawerProp.leftProp.length; i++) {
                    this.drawerLiArray.push(this.$refs[${paramsApply1}].scrollHeight);
                    if (key > i) {
                      scrollHeight += this.$refs[${paramsApply1}].scrollHeight
                    }
                  }
                  this.$refs.scrollViewRight.scrollTo(0, scrollHeight);
                  this.drawerProp.active = key;
                }, 300)
              },
              //抽屉右边 监听鼠标滚动
              addWheelChange() {
                setTimeout(() => {
                  let scrollTop = 0;
                  for (let i = 0; i < this.drawerLiArray.length; i++) {
                    scrollTop += this.drawerLiArray[i];
                    if (scrollTop > this.$refs.scrollViewRight.scrollTop) {
                      this.drawerProp.active = i;
                      return false;
                    }
                  }
                }, 300)
              },
              //附件下载
              uploadFileDownload(url, item) {
                //下载不了是跨域的问题
                const URL = url
                window.URL = window.URL || window.webkitURL
                let xhr = new XMLHttpRequest()
                xhr.open('get', URL, true)
                xhr.responseType = 'blob'
                xhr.onload = function () {
                  if (this.status == 200) {
                    //得到一个blob对象
                    let blob = this.response
                    let fileUrl = window.URL.createObjectURL(blob)
                    let a = document.createElement('a')
                    ;(document.body || document.documentElement).appendChild(a)
                    a.href = fileUrl
                    if ('download' in a) {
                      a.download = item.name
                    } else {
                      a.setAttribute('download', item.name)
                    }
                    a.target = '_self'
                    a.click()
                    a.remove()
                  }
                }
                xhr.send()
              },
              //图片放大下载 开始
              clickImage() {
                this.$nextTick(() => {
                  let wrapper = document.getElementsByClassName(
                      'el-image-viewer__actions__inner'
                  )
                  let downImg = document.createElement('i')
                  downImg.setAttribute('class', 'el-icon-download')
                  wrapper[0].appendChild(downImg)
                  if (wrapper.length > 0) {
                    this.wrapperElem = wrapper[0]
                    this.cusClickHandler()
                  }
                })
              },
              cusClickHandler() {
                this.wrapperElem.addEventListener('click', this.hideCusBtn)
              },
              hideCusBtn(e) {
                let className = e.target.className
                if (className === 'el-icon-download') {
                  let imgUrl = document.getElementsByClassName(
                      'el-image-viewer__canvas'
                  )[0].children[0].src
                  this.downloadImage(imgUrl)
                }
              },
              downloadImage(imgUrl) {
                let tmpArr = imgUrl.split('/')
                let fileName = tmpArr[tmpArr.length - 1]
                window.URL = window.URL || window.webkitURL
                let xhr = new XMLHttpRequest()
                xhr.open('get', imgUrl, true)
                xhr.responseType = 'blob'
                xhr.onload = function () {
                  if (this.status == 200) {
                    //得到一个blob对象
                    let blob = this.response
                    let fileUrl = window.URL.createObjectURL(blob)
                    let a = document.createElement('a')
                    ;(document.body || document.documentElement).appendChild(a)
                    a.href = fileUrl
                    if ('download' in a) {
                      a.download = fileName
                    } else {
                      a.setAttribute('download', fileName)
                    }
                    a.target = '_self'
                    a.click()
                    a.remove()
                  }
                }
                xhr.send()
              },
              //图片放大下载结束
              //table 批量删除
              tableTitleButBatchDel() {
                this.$confirm('此操作将永久删除, 是否继续?', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
                }).then(() => {
                  let params = {
                    ids: this.tableProp.tableSelectAll.length > 0 ? this.tableProp.tableSelectAll.toString() : ''
                  }
                  ${paramsApply2}(params).then(() => {
                    this.$message.success('批量删除成功');
                    this.initData();
                  })
                }).catch(() => {
                  this.$message.info('已取消批量删除');
                });
              },
              //table 计算高度
              calculationHeight() {
                setTimeout(() => {
                  this.tableProp.tableHeight = document.documentElement.clientHeight - 220 - this.$refs.title.clientHeight - this.$refs.tabs.clientHeight - this.$refs.tableTopBut.clientHeight;
                }, 300)
              },
              //tabs or table dialog 初始化
              tabsOrTableInit() {
                this.toConfigureFieldDialog.loading = true;
                let data = {
                  tableId: this.apiProp.tabsOrTableId
                }
                this.$commonApi2(data).then((result) => {
                  if (result.data && result.data.data) {
                    this.toConfigureFieldDialog = JSON.parse(result.data.data);
                  } else {
                    this.toConfigureFieldDialog = this.$options.data().toConfigureFieldDialog;
                  }

                  this.toConfigureFieldDialog.isDialog = false;
                  this.toConfigureFieldDialog.loading = false;
                  let tabsFieldPropNum = 0; //有几个li
                  for (let i = 0; i < this.toConfigureFieldDialog.tabsProp.length; i++) {

                    for (let j = 0; j < this.toConfigureFieldDialog.tabsProp[i].option.length; j++) {
                      if (this.toConfigureFieldDialog.tabsProp[i].option[j].checkbox) {
                        tabsFieldPropNum++
                      }
                    }
                  }
                  if (this.$refs.commonTabsFrom) {
                    let aLineNum = parseInt((this.$refs.commonTabsFrom.clientWidth / 462).toString());//一行几个
                    this.tabsProp.liHtmlNum = aLineNum - tabsFieldPropNum % aLineNum - 1;//差几个li
                  }
                })
              },
              //tabs or table dialog 点击搜索
              tabsOrTableSearch(search) {
                if (search) {
                  for (let i = 0; i < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status].length; i++) {
                    let oneShow = false;//第一层是否显示
                    for (let j = 0; j < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option.length; j++) {
                      if (this.Utils.fuzzySearch(search, this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].label)) {
                        this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].show = true;
                        oneShow = true;
                      } else {
                        this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].show = false;
                      }
                    }
                    this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].show = oneShow;
                  }
                } else {
                  for (let i = 0; i < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status].length; i++) {
                    this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].show = true;
                    for (let j = 0; j < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option.length; j++) {
                      this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].show = true;
                    }
                  }
                }
              },
              //tabs or table dialog 拖动点击删除
              tabsOrTableClose(item, key) {
                this.toConfigureFieldDialog.draggableProp.splice(key, 1);
                for (let i = 0; i < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status].length; i++) {
                  for (let j = 0; j < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option.length; j++) {
                    if (this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].label === item.label) {
                      this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].checkbox = false;
                    }
                  }
                }
              },
              //tabs or table dialog 清空以前的设置
              tabsOrTableDialogEmpty() {
                this.$confirm('此操作将永久清空搜索和表头设置, 是否继续?', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
                }).then(() => {
                  let data = {
                    tableId: this.apiProp.tabsOrTableId,
                    data: null
                  }
                  this.$commonApi(data).then(() => {
                    this.$message.success('清空设置成功');
                    this.toConfigureFieldDialog = this.$options.data().toConfigureFieldDialog;
                  })
                }).catch(() => {
                  this.$message.info('已取消清空设置');
                });
              },
              //tabs or table dialog 还原初始化
              tabsOrTableDialogReductionInit(status) {
                this.toConfigureFieldDialog.loading = true;
                let data = {
                  tableId: this.apiProp.tabsOrTableId,
                }
                this.$commonApi2(data).then((result) => {
                  if (result.data && result.data.data) {
                    this.toConfigureFieldDialog = JSON.parse(result.data.data);
                  } else {
                    this.toConfigureFieldDialog = this.$options.data().toConfigureFieldDialog;
                  }
                  this.toConfigureFieldDialog.status = status;
                  this.toConfigureFieldDialog.draggableProp = [];
                  for (let i = 0; i < this.toConfigureFieldDialog[status].length; i++) {
                    for (let j = 0; j < this.toConfigureFieldDialog[status][i].option.length; j++) {
                      if (this.toConfigureFieldDialog[status][i].option[j].checkbox) {
                        this.toConfigureFieldDialog.draggableProp.push(this.toConfigureFieldDialog[status][i].option[j])
                      }
                    }
                  }
                  this.toConfigureFieldDialog.selectNum = this.toConfigureFieldDialog.draggableProp.length;
                  this.toConfigureFieldDialog.isDialog = true;
                  this.toConfigureFieldDialog.loading = false;
                })
              },
              //tabs or table dialog 点击 关闭 取消
              tabsOrTableCancel() {
                this.tabsOrTableInit();
              },
              //tabs or table dialog 点击确定
              tabsOrTableDetermine() {
                this.toConfigureFieldDialog.loading = true;
                this.toConfigureFieldDialog.search = '';
                this.tabsOrTableSearch(this.toConfigureFieldDialog.search);
                for (let i = 0; i < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status].length; i++) {
                  for (let j = 0; j < this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option.length; j++) {
                    for (let k = 0; k < this.toConfigureFieldDialog.draggableProp.length; k++) {
                      if (this.toConfigureFieldDialog.draggableProp[k].label === this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].label) {
                        this.toConfigureFieldDialog[this.toConfigureFieldDialog.status][i].option[j].order = k;
                      }
                    }
                  }
                }
                let data = {
                  tableId: this.apiProp.tabsOrTableId,
                  data: JSON.stringify(this.toConfigureFieldDialog)
                }
                this.$commonApi(data).then(() => {
                  this.$message.success('保存成功');
                  this.tabsOrTableInit();
                  this.tabsSearchData = this.$options.data().tabsSearchData;
                  this.initData();
                })
              },
              //tabs or table dialog 点击选择
              tabsOrTableChecked(item) {
                if (item.checkbox) {
                  this.toConfigureFieldDialog.draggableProp.push(item)
                } else {
                  for (let i = 0; i < this.toConfigureFieldDialog.draggableProp.length; i++) {
                    if (this.toConfigureFieldDialog.draggableProp[i].label === item.label) {
                      this.toConfigureFieldDialog.draggableProp.splice(i, 1);
                    }
                  }
                }
                this.toConfigureFieldDialog.selectNum = this.toConfigureFieldDialog.draggableProp.length;
              },
              //tabs table 设置图标和按钮 dialog拖拽
              tabsOrTableSetClick(status, title) {
                this.toConfigureFieldDialog.loading = true;
                this.toConfigureFieldDialog.isDialog = true;
                let data = {
                  tableId: this.apiProp.tabsOrTableId,
                }
                this.$commonApi2(data).then((result) => {
                  if (result.data && result.data.data) {
                    this.toConfigureFieldDialog = JSON.parse(result.data.data)
                  }
                  this.toConfigureFieldDialog.title = title;
                  this.toConfigureFieldDialog.status = status;
                  this.toConfigureFieldDialog.draggableProp = [];
                  for (let i = 0; i < this.toConfigureFieldDialog[status].length; i++) {
                    for (let j = 0; j < this.toConfigureFieldDialog[status][i].option.length; j++) {
                      if (this.toConfigureFieldDialog[status][i].option[j].checkbox) {
                        this.toConfigureFieldDialog.draggableProp.push(this.toConfigureFieldDialog[status][i].option[j])
                      }
                    }
                  }
                  //排序
                  this.toConfigureFieldDialog.draggableProp.sort(function (p1, p2) {
                    return p1.order - p2.order
                  })
                  this.toConfigureFieldDialog.selectNum = this.toConfigureFieldDialog.draggableProp.length;
                  this.toConfigureFieldDialog.loading = false;
                })
              },
      `;
      //其它全部的方法集合 结束

      //生成vue文件 开始
      let resVueData = `<template>
                  <div>
                  <!--title-->
                  <div class="content-title" ref="title"><div class= "su-title">
                   <i class="el-icon-tickets"> </i>
                  <span>${this.propsData.titleName}</span>
                </div>
                  <div class="batch-but-css">
                    ${titleButVue} </div>
                </div>

                  <!--tabs-->
                  <div class="common-tabs" ref="tabs">
                    <el-tabs v-model="tabsProp.active" @tab-click="tabsSwitchClick">
                    <el-tab-pane name="" label="全部"/>
                    ${tabPane} </el-tabs>
                    ${tabsSearchVue} </div>

                  <!--table-->
                  <template>
                    <!--表格前的按钮-->
                    <div class="common-table-title-but" ref="tableTopBut">
                      ${tableHeadButVue} </div>
                      <!--表格内容-->
                      <el-table
                          ref="table"
                      :data="tableData"
                      border
                      style="width: 100%"
                      :max-height="tableProp.tableHeight"
                      :header-cell-style="{background:'#f5f7fa',color:'#081333',fontWeight: 'normal'}"
                      v-loading="tableProp.loading"
                      @selection-change="tableSelectionChange"
                      class="cc-table-style"
                      >
                      ${tableContentVue} </el-table>
                    ${tablePageVue} </template>

                  <!--抽屉增加和修改-->
                  <el-drawer
                  :title="drawerProp.title"
                  :visible.sync="drawerProp.isDrawer"
                  direction="rtl"
                  :append-to-body="true"
                  :modal-append-to-body="false"
                  custom-class="common-drawer"
                  size="1050px"
                >
                      <div class="common-drawer-content" v-loading="drawerProp.loading">
                      <div class="parent">
                      <!--左边-->
                      <div class="leftChild">
                      <ul class="content">
                      ${drawerContentLeft} </ul>
                </div>
                  <!--右边-->
                  <div class="rightChild">
                    <ul class="content" ref="scrollViewRight" @wheel.passive="addWheelChange" :style="{'height': drawerProp.rightProp.height+'px'}">
                    ${drawerContentRight} </ul>
                </div>
                </div>
                  <!--操作按钮-->
                  <template>
                    <div class="common-drawer-title-add-edit" v-if="drawerProp.status==='add'">
                      <el-button icon="el-icon-close el-icon--left" @click="drawerProp.isDrawer=false">取 消</el-button>
                      <el-button type="primary" icon="el-icon-check el-icon--left" @click="drawerSubmitForm('add')">保 存</el-button>
                </div>
                  <div class="common-drawer-title-add-edit" v-if="drawerProp.status==='edit'">
                    <el-button icon="el-icon-close el-icon--left" @click="drawerSubmitForm('see')">取 消</el-button>
                    <el-button type="primary" icon="el-icon-check el-icon--left" @click="drawerSubmitForm('edit')">保 存</el-button>
                </div>
                  ${butDrawerVue}
                </template>
                </div>
                </el-drawer>

                  <!--dialog 集合-->
                  ${titleDialogData}
                  ${tableDialogVue}

                  <!--tabs和table dialog 字段选择显示问题-->
                 <el-dialog
        :append-to-body="true"
        :close-on-click-modal="false"
        :show-close="true"
        :close-on-press-escape="false"
        :title="toConfigureFieldDialog.title"
        :visible.sync="toConfigureFieldDialog.isDialog"
        custom-class="toConfigure-field-dialog"
        @close="tabsOrTableCancel"
        width="1060px"
    >
      <div class="toConfigure-field-dialog-content" v-loading="toConfigureFieldDialog.loading">
        <div class="left">
          <el-input placeholder="搜索字段" v-model="toConfigureFieldDialog.search" class="input-with-select">
            <el-button slot="append" icon="el-icon-search" @click="tabsOrTableSearch(toConfigureFieldDialog.search)"/>
          </el-input>
          <div class="parent">
            <div class="child">
              <el-scrollbar wrap-class="scrollbar-x" style="height: 100%">
                <template v-for="(item,key) in toConfigureFieldDialog[toConfigureFieldDialog.status]">
                  <dl :key="key" class="content" v-if="item.show">
                    <dt>{{ item.name }}</dt>
                    <dd>
                      <template v-for="(item2, key2) in item.option">
                        <el-checkbox v-model="item2.checkbox" @change="tabsOrTableChecked(item2)" :key="key2" v-if="item2.show" :disabled="item2.disabled">
                          <el-tooltip class="item" :disabled="item2.label.length<8" effect="dark" :content="item2.label" placement="top-start" :key="key">
                            <div class="tooltip">{{ item2.label }}</div>
                          </el-tooltip>
                        </el-checkbox>
                      </template>
                    </dd>
                  </dl>
                </template>
              </el-scrollbar>
            </div>
          </div>
        </div>

        <div class="right">
          <div class="title">
            已选择（{{ toConfigureFieldDialog.selectNum }}）
          </div>
          <div class="parent">
            <div class="child">
              <el-scrollbar wrap-class="scrollbar-x" style="height: 100%">
                <!--tabs配置-->
                <ul class="content" v-if="toConfigureFieldDialog.status==='tabsProp'">
                  <draggable v-model="toConfigureFieldDialog.draggableProp">
                    <template v-for="(item,key) in toConfigureFieldDialog.draggableProp">
                      <li :key="key">
                        <i class="el-icon-thumb"/><span>{{ item.label }}</span><i class="el-icon-close" @click="tabsOrTableClose(item,key)" v-show="!item.disabled"></i>
                      </li>
                    </template>
                  </draggable>
                </ul>
                <!--table配置-->
                <ul class="content" v-if="toConfigureFieldDialog.status==='tableProp'">
                  <template v-for="(item,key) in toConfigureFieldDialog.draggableProp">
                    <li :key="key">
                      <i class="el-icon-thumb"/><span>{{ item.label }}</span>
                      <el-select v-model="item.fixed" class="frozenSelect">
                        <el-option v-for="item in $store.state.tableFixed" :key="item.value" :label="item.label" :value="item.value"/>
                      </el-select>
                      <i class="el-icon-close" @click="tabsOrTableClose(item,key)"></i>
                    </li>
                  </template>
                </ul>
              </el-scrollbar>
            </div>
          </div>
        </div>
      </div>
      <div slot="footer" class="toConfigure-field-dialog-footer">
        <el-button type="danger" @click="tabsOrTableDialogReductionInit(toConfigureFieldDialog.status)" icon="el-icon-delete el-icon--left">还原初始化</el-button>
        <el-button @click="tabsOrTableCancel" icon="el-icon-close el-icon--left">取 消</el-button>
        <el-button type="primary" @click="tabsOrTableDetermine" icon="el-icon-check el-icon--left">确 定</el-button>
      </div>
    </el-dialog>
                </div>
                </template>
                  <script>
                    import draggable from 'vuedraggable'
                    export default {
                    name: '${this.propsData.fileName}',
                    components: {draggable},
                    props: [],
                    data() {
                    return {
                    //接口名称
                    apiProp: {
                    tableInit: '${this.propsData.fileName}List',//表格初始化
                    tableAddEdit: '${this.propsData.fileName}AddEdit',//表格增加和编辑接口
                    tableDel: '${this.propsData.fileName}Del',//表格删除接口
                    tableQuery: '${this.propsData.fileName}Query',//表格查一条接口
                    tableBatchDel: '${this.propsData.fileName}BatchDel',//批量删除接口
                    tabsOrTableId: ${this.propsData.searchId},//设置搜索条件和表头id
                    selectApiBoolean: false,//比初始化接口先运行的接口是否先运行完成
                  },
                    headersData: {token:window.localStorage.getItem('token')},//导入之类要用

                    //title 配置
                    titleProp:{${titleData}},

                    //tabs 配置
                    tabsProp: {
                    active: '',
                    ${tabsProp}
                    SearchDropDown: true,//高级搜索下拉默认显示状态
                    liHtmlNum: '',//有高级搜索时候差几个li
                  },
                    //tabs 搜索字段
                    tabsSearchData: {${tabsSearchData}},
                    //tabs 选项
                    tabsSearchOption:{
                    ${tabsSearchOption}},

                    //table 数据
                    tableData: [${demoDataProp}
                    ],
                    tableProp: {
                    loading: false,
                    tableHeight: 0,
                    tableSelectAll: [],//表格多选的值
                  },
                    // table 选项
                    tableSearchOption: {${tableSearchOption}},
                    //table dialog data
                    tableDialogProp:{${tableDialogProp}},

                    // 抽屉 值
                    formData:{${formData}},
                    // 抽屉 选项
                    formDataOption:{${formDataOption}},
                    //抽屉 配置
                    drawerProp: {
                    isDrawer: false,
                    loading: false,
                    title: '',
                    seeBut:${this.propsData.tableProp.isSeeOrEditBut == 1 ? true : false},//是否是 查看/编辑 只有查看就是false
                    active: 0,//左边选择了哪个
                    status: 'add',// add 新增  see 查看
                    leftProp: [${drawerLeftProp}],
                    rightProp: {
                    height: document.documentElement.clientHeight - 90,//右边高度
                  }
                  },

                    //分页配置
                    paginationProp: {
                    currentPage: 1,//当前第几页
                    pageSize: 10,//每页几条
                    total: 0,//总数
                  },
                    //tabs和table dialog 字段选择显示
                    toConfigureFieldDialog: {
                    isDialog: false,
                    title: '筛选项配置',
                    loading: false,
                    status: 'tabsProp',
                    search: '',//搜索的值
                    selectNum: 0,//选择的数量
                    frozenFrontNum: 0,//冻结前几条
                    frozenAfterNum: 0,//冻结后几条
                    draggableProp: [],//拖拽数据
                    tabsProp:[
                    ${toConfigureFieldDialogTabsProp}],
                    tableProp:[
                    ${toConfigureFieldDialogTableProp}]
                  }
                  };
                  },
                    activated(){
                    ${titleActivated} ${tabsActivated} ${tableActivated} ${tableDialogActivated} ${drawerActivated}},
                    mounted() {
                    //高级搜索差几个li
                    this.tabsOrTableInit();
                    this.initData();//数据初始化
                    this.calculationHeight();//table计算高度
                    //监听浏览器变化
                    window.onresize = () => {
                    return (() => {
                    this.calculationHeight();//table计算高度
                  })();
                  };
                  },
                    watch: {
                    //主要作用监听赋值给table高度
                    'tabsProp.SearchDropDown'() {
                    this.calculationHeight();//table计算高度
                  },
                  },
                    computed:{
                    ${titleComputed}},
                    methods: {
                    ${initMethods}
                    ${tableSeeMethods}
                    ${drawerSubmitForm}
                    ${drawerEdit}
                    ${drawerArrayMethod} ${titleMethod} ${tableDialogMethod} ${otherAllMethods} //tabs 高级搜索 重置按钮
                  },
                  };
                    ${this.generateData.endScript}
                    ${this.generateData.allStyle}
                    `;
      let jsonData = {
        name: `${this.propsData.fileName}.vue`,//文件名称
        data: resVueData,
        status: `${this.propsData.fileName} vue文件`,
      }
      this.exportFileData.push(jsonData)
      //生成vue文件 结束

      //生成api文件 开始
      let resApiData = `import http from '../http';
      `;
      let aggregateApiArray = this.propsData.apiProp.apiArray.concat(this.propsData.apiProp.apiArray2);//api集合
      for (let i = 0; i < aggregateApiArray.length; i++) {
        resApiData += `//${aggregateApiArray[i].notes}
            export function ${aggregateApiArray[i].name}(${aggregateApiArray[i].paramsMode}) {
                return http({
                    url: '${aggregateApiArray[i].path}',
                    method: "${aggregateApiArray[i].mode}",
                    ${aggregateApiArray[i].paramsMode}: ${aggregateApiArray[i].paramsMode}
                })
            }
          `
      }
      let apiJsonData = {
        name: `${this.propsData.fileName}Api.js`,//api文件名称
        data: resApiData,//api 数据
        status: `${this.propsData.fileName}api文件`
      }
      this.exportFileData.push(apiJsonData)
      //生成api文件 结束

      //生成备份生成器生成数据文件 开始
      let backupsData = "";
      backupsData = JSON.stringify(this.propsData);
      let backupsJsonData = {
        name: `${this.propsData.fileName}backups.js`,//api文件名称
        data: backupsData,//api 数据
        status: `${this.propsData.fileName}备份生成器生成数据文件`
      }
      this.exportFileData.push(backupsJsonData)
      //生成备份生成器生成数据文件 结束
      //生成文件
      if (this.exportFileData.length) {
        (async () => {
          //-----------------------------------------------------
          //批量生成路由文件
          for (let i = 0; i < this.exportFileData.length; i++) {
            await this.Utils.delay(1000);
            //生成文件
            let codeStr = this.exportFileData[i].data;
            let blob = new Blob([codeStr], {type: 'text/plain;charset=utf-8'})
            saveAs(blob, this.exportFileData[i].name)
          }

        })();
      }
    },

    //导入备份生成器数据
    importBackupClick(file) {
      const reader = new FileReader()
      reader.readAsText(file.raw)
      reader.onload = (event) => {
        let propsData = event.target.result;
        let propsDataCody = JSON.parse(propsData)
        console.log(propsDataCody)
        for (let i = 0; i < propsDataCody.tableProp.groupNameProp.arrayData.length; i++) {
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].isArray;
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].field;
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].name;
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].isArrayParams;
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].params;
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].apiAnnotationPrefix;
          delete propsDataCody.tableProp.groupNameProp.arrayData[i].fieldId;
        }
        this.propsData = propsDataCody;
        this.$message.success('导入成功');
      }
    },
    //初始化
    initializationClcik() {
      this.$confirm('此操作将刷新页面初始化?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$router.go(0);
      }).catch(() => {
        this.$message.info('已取消初始化');
      });
    },
    //暂存当前生成数据
    temporaryStorage1() {
      this.$confirm('是否暂存当前生成数据?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        window.localStorage.setItem('propsData', JSON.stringify(this.propsData));
        this.$message.success('暂存成功');
      }).catch(() => {
        this.$message.info('已取消暂存当前生成数据');
      });
    },
    //读取前面暂存的数据
    temporaryStorage2() {
      this.$confirm('是否读取前面暂存的数据?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let propsData = window.localStorage.getItem('propsData');
        if (propsData) {
          let propsDataCody = JSON.parse(propsData)
          for (let i = 0; i < propsDataCody.tableProp.groupNameProp.arrayData.length; i++) {
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].isArray;
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].field;
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].name;
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].isArrayParams;
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].params;
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].apiAnnotationPrefix;
            delete propsDataCody.tableProp.groupNameProp.arrayData[i].fieldId;
          }
          this.propsData = propsDataCody;
          this.$message.success('读取成功');
        } else {
          this.$message.error('暂无暂存数据');
        }
      }).catch(() => {
        this.$message.info('已取消读取前面暂存的数据');
      });
    },

    //表格数据解析
    startParsingClick() {
      if (!this.propsData.tableDataParsing) {
        this.$message.error('请输入解析数据')
        return false
      }
      let dataParsing = this.propsData.tableDataParsing.split('\n')
      for (let i = 0; i < dataParsing.length; i++) {
        let data = dataParsing[i].trim().split(';//');
        if (data[1].includes('：')) {
          //处理多选框，单选框，下拉框 值
          let analysis1 = data[1].split('：');
          let analysis2 = analysis1[1].split('，');
          let optionJson = ''
          for (let j = 0; j < analysis2.length; j++) {
            let optionData = analysis2[j].split('-');
            optionJson += `{label:'${optionData[1]}',value:'${optionData[0]}'},
`
          }
          let jsonData = {
            id: new Date().getTime(),
            name: analysis1[0],//名称
            type: '下拉框',//数据类型
            field: data[0],//字段
            startField: '',//开始字段 时间范围
            endField: '',//结束字段 时间范围
            singleFile: true,//文件上传和图片是否多个文件  true 多个

            required: false,//是否必填 true 必填
            display: false,//不可更改  true 不可更改
            rowData: false,//是否row数据 true 是
            tabsSearch: false,//tabs搜索 true搜索
            sort: '10',//排序
            tableSee: false,//表格不显示 true是
            drawerSee: false,//抽屉查看不显示 true是
            drawerEdit: false,//抽屉编辑不显示 true是
            drawerSeeALine: true,//抽屉查看满一行 true是
            tabsSearchField: false,//tabs搜索字段
            isArray: false,//是否是数组
            groupName: '基础设置',//分组名称
            //单选框-下拉框-多选框 数据来源
            selectProp: {
              dataSources: '自定义',//单选框-下拉框-多选框 数据来源
              interfaceName: '',// 单选框-下拉框-多选框 本页或已有接口 接口名称
              labelField: '',//label字段
              valueField: '',//value字段
              //自定义 下拉框
              text: optionJson,
            },
          }
          this.propsData.tableProp.tableArray.push(jsonData);
        } else {
          let jsonData = {
            name: data[1],//名称
            type: '输入框',//数据类型
            field: data[0],//字段
            startField: '',//开始字段 时间范围
            endField: '',//结束字段 时间范围
            singleFile: true,//文件上传和图片是否多个文件  true 多个

            required: false,//是否必填 true 必填
            display: false,//不可更改  true 不可更改
            rowData: false,//是否row数据 true 是
            tabsSearch: false,//tabs搜索 true搜索
            sort: '10',//排序
            tableSee: false,//表格不显示 true是
            drawerSee: false,//抽屉查看不显示 true是
            drawerEdit: false,//抽屉编辑不显示 true是
            drawerSeeALine: true,//抽屉查看满一行 true是
            tabsSearchField: false,//tabs搜索字段
            isArray: false,//是否是数组
            groupName: '基础设置',//分组名称
            //单选框-下拉框-多选框 数据来源
            selectProp: {
              dataSources: '自定义',//单选框-下拉框-多选框 数据来源
              interfaceName: '',// 单选框-下拉框-多选框 本页或已有接口 接口名称
              labelField: '',//label字段
              valueField: '',//value字段
              //自定义 下拉框
              text: `{label:'',value:''},`,
            },
          }
          this.propsData.tableProp.tableArray.push(jsonData);
        }
        this.propsData.tableProp.isDrawer = true;
      }
    },
    //导入生成路由
    upload(file) {// fileList
      let files = {0: file.raw}// 取到File
      this.readExcel(files)
    },
    readExcel(files) { // 表格导入
      if (files.length <= 0) { // 如果没有文件名
        return false
      } else if (!/\.(xls|xlsx)$/.test(files[0].name.toLowerCase())) {
        this.$message.success('上传格式不正确，请上传xls或者xlsx格式');
        return false
      }
      const fileReader = new FileReader()
      fileReader.onload = (ev) => {
        try {
          const data = ev.target.result
          const workbook = XLSX.read(data, {
            type: 'binary'
          })
          const wsname = workbook.SheetNames[0]// 取第一张表
          let xlsxLth = workbook.Sheets[workbook.SheetNames[0]]["!ref"];
          let stopX = xlsxLth.substr(xlsxLth.indexOf(':') + 1, workbook.Sheets[workbook.SheetNames[0]]["!ref"].length);
          workbook.Sheets[workbook.SheetNames[0]]["!ref"] = "A2:" + stopX;//过滤头部几行生成数据
          const ws = XLSX.utils.sheet_to_json(workbook.Sheets[wsname]);// 生成json表格内容
          //开始处理数据
          //路由数据
          let routesData = `
                      {
                              path: '/redirect',
                              component: Layout,
                              meta: {authority: [0], id: 20000},
                              children: [
                                  {
                                      meta: {authority: [100], id: 20000},
                                      path: '/redirect/:path(.*)',
                                      component: () => import(/* webpackChunkName: "redirect-index" */ '@/views/redirect/index')
                                  }
                              ]
                      },
                      {
                          path: '/',
                          redirect: '/login',
                          meta: {authority: [0]},
                      }, {
                          path: '/login',
                          name: 'login',
                          meta: {authority: [0]},
                          component: () => import(/* webpackChunkName: "login" */ '@/views/login')
                      },{
                          path: '/dashboard',
                          name: 'dashboard',
                          component: Layout,
                          redirect: '/dashboard/index',
                          meta: {title: '首页', authority: [100], onlyOne: 1, id: 20000, icon: 'el-icon-s-home'},
                          children: [{
                              path: 'index',
                              name: 'index',
                              meta: {title: '首页', authority: [100]},
                              component: () => import(/* webpackChunkName: "dashboard" */ '@/views/dashboard')
                          }]
                      },
                `;
          //空的vue文件数据
          let nullVueData = `
          <template>
  <div></div>
</template>

<script>
export default {
  components: {},
  props: [],
  data() {
    return {};
  },
  activated() {
  },
  mounted() {
  },
  methods: {},
};
${this.generateData.endScript}
${this.generateData.allStyle}
`
          let routerTwoArray = []; //路由二级数组
          //导入数据处理
          for (let i = 0; i < ws.length; i++) {
            //页面名称不能为空
            if (!ws[i]['页面名称']) {
              this.$message.error(`${i + 3}---页面名称不能为空`);
              return false;
            }
            //不能同时设置id和pid
            if (ws[i]['id'] && ws[i]['pid']) {
              this.$message.error(`${i + 3}---不能同时设置id和pid`);
              return false;
            }
            //id必须唯一
            if (ws[i]['id']) {
              let num = 0;
              for (let k = 0; k < ws.length; k++) {
                if (ws[i]['id'] == ws[k]['id']) {
                  num++
                  if (num > 1) {
                    this.$message.error(`${i + 3}---id必须唯一`);
                    return false;
                  }
                }
              }
            }
            //配置一级导航
            if (!ws[i]['id'] && !ws[i]['pid']) {
              routesData += `
                              {
                                path: '/navigation${i}',
                                name: 'navigation${i}',
                                component: Layout,
                                redirect: '/navigation${i}/index',
                                meta: {title: '${ws[i]['页面名称']}', authority: [100], onlyOne: 1, id: 20000, icon: '${ws[i]['图标'] ? ws[i]['图标'] : 'el-icon-s-home'}'},
                                children: [{
                                    path: 'index',
                                    name: 'navigation${i}',
                                    meta: {title: '${ws[i]['页面名称']}', authority: [100]},
                                    component: () => import(/* webpackChunkName: "navigation${i}" */ '@/views/navigation${i}')
                                }]
                            },
                  `
              let jsonData = {
                name: `navigation${i}.vue`,//文件名称
                data: nullVueData,
                status: `navigation${i} vue文件`,
              }
              this.exportFileData.push(jsonData)
            } else if (ws[i]['id']) {
              //二级导航的一级导航
              let jsonData = {
                id: ws[i]['id'],//路由id层
                path: `navigation${i}`,
                meta: {
                  title: `${ws[i]['页面名称']}`,
                  authority: 100,
                  icon: `${ws[i]['图标'] ? ws[i]['图标'] : 'el-icon-loading'}`,
                  id: 20000,
                },
                children: []
              }
              routerTwoArray.push(jsonData)
            } else if (ws[i]['pid']) {
              for (let k = 0; k < routerTwoArray.length; k++) {
                if (routerTwoArray[k].id == ws[i]['pid']) {
                  let jsonData = {
                    path: `navigation${i}`,
                    meta: {
                      title: `${ws[i]['页面名称']}`,
                      authority: 100,
                      id: 20000,
                    },
                  }
                  routerTwoArray[k].children.push(jsonData)
                }
              }
            }

            // let exportRouterData= '';//导出的路由数据

          }
          //处理二级导航数据
          for (let j = 0; j < routerTwoArray.length; j++) {
            let childrenData = ''
            for (let k = 0; k < routerTwoArray[j].children.length; k++) {
              //子导航
              childrenData += `
                            {
                                path: '${routerTwoArray[j].children[k].path}',
                                name: '${routerTwoArray[j].children[k].path}',
                                meta: {title: '${routerTwoArray[j].children[k].meta.title}', authority: [100], id: 20000},
                                component: () => import(/* webpackChunkName: "${routerTwoArray[j].children[k].path}" */ '@/views/${routerTwoArray[j].children[k].path}')
                            },
                  `
              let jsonData = {
                name: `${routerTwoArray[j].children[k].path}.vue`,//文件名称
                data: nullVueData,
                status: `${routerTwoArray[j].children[k].path} vue文件`,
              }
              this.exportFileData.push(jsonData)
            }

            //二级导航全部内容
            let twoData = `
                        {
                          path: '/${routerTwoArray[j].path}',
                          name: '${routerTwoArray[j].path}',
                          component: Layout,
                          redirect: '/${routerTwoArray[j].path}/${routerTwoArray[j].children[0].path}',
                          meta: {title: '${routerTwoArray[j].meta.title}', authority: [100], id: 20000, icon: '${routerTwoArray[j].meta.icon}'},
                          children: [${childrenData}]
                        },
                `
            routesData += twoData;
          }
          routesData += `
                            {
                                path: '/systemSettings',
                                name: 'systemSettings',
                                component: Layout,
                                redirect: '/systemSettings/roleSetUp',
                                meta: {title: '系统设置', authority: [100], id: 20000, icon: 'el-icon-setting'},
                                children: [{
                                    path: 'roleSetUp',
                                    name: 'roleSetUp',
                                    meta: {title: '角色设置', authority: [100], id: 20000},
                                    component: () => import(/* webpackChunkName: "/systemSettings/roleSetUp" */ '@/views/systemSettings/roleSetUp')
                                },{
                                    path: 'accountSettings',
                                    name: 'accountSettings',
                                    meta: {title: '账号设置', authority: [100], id: 20000},
                                    component: () => import(/* webpackChunkName: "/systemSettings/accountSettings" */ '@/views/systemSettings/accountSettings')
                                },{
                                    path: 'systemLog',
                                    name: 'systemLog',
                                    meta: {title: '系统日志', authority: [100], id: 20000},
                                    component: () => import(/* webpackChunkName: "/systemSettings/systemLog" */ '@/views/systemSettings/systemLog')
                                }]
                            },
              `
          let routerData = `
                    import Vue from 'vue'
                    import VueRouter from 'vue-router'
                    Vue.use(VueRouter)
                    import Layout from '@/layout'
                    const routes =[${routesData}]
                    const router = new VueRouter({
                        routes
                    })
                    export default router
                `
          let jsonData = {
            name: 'index.js',//文件名称
            data: routerData,
            status: '路由文件',
          }
          this.exportFileData.push(jsonData)
          if (this.exportFileData.length) {
            (async () => {
              //-----------------------------------------------------
              //批量生成路由文件
              for (let i = 0; i < this.exportFileData.length; i++) {
                await this.Utils.delay(1000);
                //生成文件
                let codeStr = this.exportFileData[i].data;
                let blob = new Blob([codeStr], {type: 'text/plain;charset=utf-8'})
                saveAs(blob, this.exportFileData[i].name)
              }

            })();
          }
        } catch (e) {
          return false
        }
      }
      fileReader.readAsBinaryString(files[0])
    },

    //下载导入生成路由模板
    downloadImportTemplate(name) {
      window.location.href = `/666/${name}`
    },
    //显示哪个抽屉
    drawerShow(propName) {
      this.Utils.createRandomKey();
      this.propsData[propName].isDrawer = true;
    },
    //api配置
    apiToConfigure() {
      this.propsData.apiProp.isDrawer = true;
    },
    //生成api
    generateApi() {
      // reject
      return new Promise((resolve) => {
        if (this.propsData.fileName == 'navigation') {
          this.$message.error('请填写文件名称！！');
          resolve(false)
          return false
        }
        this.$refs['analysisGeneration-content1-form'].validate((valid) => {
          if (valid) {
            this.propsData.apiProp.apiArray = [];
            //table分页列表
            let JsonData1 = {
              notes: 'table 分页列表',//api注释
              name: `${this.propsData.fileName}List`,//api 方法名
              path: `/${this.propsData.tableName}/list.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'params',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData1);
            //table 新增/修改
            let JsonData2 = {
              notes: 'table 新增/修改',//api注释
              name: `${this.propsData.fileName}AddEdit`,//api 方法名
              path: `/${this.propsData.tableName}/save.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'data',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData2);
            //table 删除
            let JsonData3 = {
              notes: 'table 删除',//api注释
              name: `${this.propsData.fileName}Del`,//api 方法名
              path: `/${this.propsData.tableName}/delete.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'params',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData3);
            //table 单条数据查询
            let JsonData4 = {
              notes: 'table 单条数据查询',//api注释
              name: `${this.propsData.fileName}Query`,//api 方法名
              path: `/${this.propsData.tableName}/get${this.Utils.englishInitialCapital(this.propsData.tableName)}.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'params',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData4);
            //table 不分页列表
            let JsonData5 = {
              notes: 'table 不分页列表',//api注释
              name: `${this.propsData.fileName}All`,//api 方法名
              path: `/${this.propsData.tableName}/all.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'params',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData5);
            //table 批量删除
            let JsonData6 = {
              notes: 'table 批量删除',//api注释
              name: `${this.propsData.fileName}BatchDel`,//api 方法名
              path: `/${this.propsData.tableName}/patchDelete.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'params',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData6);
            //table 多条数据同时保存
            let JsonData7 = {
              notes: 'table 多条数据同时保存',//api注释
              name: `${this.propsData.fileName}PatchSave`,//api 方法名
              path: `/${this.propsData.tableName}/patchSave.do`,//请求地址
              mode: 'post',//请求方式
              paramsMode: 'data',//参数方式
            }
            this.propsData.apiProp.apiArray.push(JsonData7);
            this.$message.success('生成api成功')
            resolve(true)
          }
        });

      })

    },


  },
}
;
</script>

<style lang="scss" scoped>

</style>
